I'm having a problem with an application that i'm currently writing. I'm using Sockets to connect between a client and server. With a new
Thread running for each client Socket connection.
The problem is that my "readObject( )" method is in a "while" loop as seems to be the standard way of doing things as object will arrive at this Socket at random intervals.
The snippet of code is as follows:
Without wanting to go into too much detail with regards to the code surrounding this try block the problem basically comes down to the fact that I'm ignoring IOExceptions and it all works except it takes a very long time to register that a new Object has arrived at the Socket.
Obviously this is because that Thread is tanking along within its loop but I was under the impression that a Socket operation such as this was blocking and as such would only continue when it was able to complete.
Can anyone suggest a better way of achieving the above result but without the long delays I'm experiencing? there is no other code in this "while" loop.
Any help appreciated!
Andy.
- I drink therefore I am