socket-time-out-225x225

TCP/IP Sockets with Time Out Capabilities

Recently I had a question from one of my readers about how to close connections on a server when there are no requests received after a certain period of time.  The question was asked with regard to the tcpsockets classes I covered in my blog TCP Network Programming Design Patterns in C++, none of which support…

multithreaded-225x225

Multithreaded Work Queue Based Server in C++

Creating a multithreaded TCP/IP protocol based server requires the capabilities to handle network communication, multithreading and transferring data between threads. I have described how to build C++ components to handle this functionality in previous blogs. This time I’ll show you how to combine these components to create a simple multithreaded server.   Background Articles The…

network-socket-225x225

TCP/IP Network Programming Design Patterns in C++

Network programming with the BSD Sockets API involves making a series of boilerplate calls to several operating system level functions every time you want to create connections and transfer data over TCP/IP networks. This process can be both cumbersome and error prone. Fortunately there is an easier way to develop network applications. By thinking in…

thread-queue-225x225

Multithreaded Work Queue in C++

In my previous blog Java Style Thread Class in C++ I discussed how to develop a C++ class that enables you to create Pthread based objects that resemble Java threads. The next step to building a multithreaded application is to devise a means to distribute tasks between threads so they can be processed concurrently. Queues are good devices for transferring work items from one…

c-threads-225x225

Java Style Thread Class in C++

Java provides the Thread class that enables developers to easily create multiple threads in Java applications. Pthreads is commonly used for multithreaded programming in C and C++, but this API is procedural and somewhat less convenient to use than Java’s object oriented thread interface. However, it is possible to mimic Java threads behaviors by wrapping Pthreads calls in a C++ class…