Re: Non-blocking method for reading writing objects to sockets



Sameer wrote:
The methods writeObject and readObject of socket class are blocking
one. i.e. if we create a ObjectInputStream object using
new ObjectInputStream(socket.getInputStream()), the methods blocks
until it gets some stream stuff.
What is the corresponding non-blocking mthod so as to include in
non-blocking programming?


Technically there are not non blocking socket write methods in any language. There is either room enough in the socket write MCB to hold the data, allowing the method to return, or there is not enough room, and an error is returned to indicate a failure.


Either increase your transmit buffer size, which I believe defaults to 32kb, or find out why the data is not being transmitted to the network. If your Objects are larger then 32kb, increasing the transmit buffer is the answer. If your Objects are smaller than 32kb, then you most likely have other issues.

joseph
.