Re: Non-blocking method for reading writing objects to sockets
- From: Joseph Dionne <jdionne@xxxxxxxxxxx>
- Date: Fri, 06 May 2005 12:17:14 GMT
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 .
- Follow-Ups:
- Re: Non-blocking method for reading writing objects to sockets
- From: Esmond Pitt
- Re: Non-blocking method for reading writing objects to sockets
- References:
- Prev by Date: Re: swing book
- Next by Date: Re: Java is in danger
- Previous by thread: Non-blocking method for reading writing objects to sockets
- Next by thread: Re: Non-blocking method for reading writing objects to sockets
- Index(es):