I created a server socket on my side. I don't know when client connects to me.
Calling a serverSocket.accept() in my application without setting any socket timeout would solve my problem of accepting the client at any point of time. I am doing this in a separate thread, so this wouldn't block another part of my application.
My concern is since accept() blocks till it gets a call from a client wouldn't this consume any resources, may be like if I don't get a call from the client side program for about a week.
Is there any other way of accepting the client side connection. I don't have any information on when client calls for a socket connection, except that it calls at some point.