Java: establishing socket connection pool -
I have a client-server application using Java sockets. So far, it works in the following way: Customer opens a socket connection on the server. The socket handler thread of the server puts a new socket on a LinkedBlockingQueue. A worker takes a socket from the thread queue and reads an object from the stream (the client sends the object on the server) and writes back an answer to the client and closes the socket. But now I want to create a connection pool so that the connections can be kept open but I still want LinkedBlockingQueud. My idea is that each new connection is placed in a queue, call it openSocketQueue, and then sockethandler thread (or some other thread) runs on open sourceQueE and checks whether New data is available (without reading data). If the data is available, then it removes the socket from the queue and puts it on the linking block. The socket is not closed after the worker has finished but put it back on the open source code. Is it fair? How does a soc...