Concurrent socket read/write by threads
1 posts in topic
Flat View  Flat View

Posted By:   Jon_Branham
Posted On:   Sunday, April 20, 2003 09:36 AM

I was wondering if it is a bug or illegal in the java library to have two threads(one reading and one writing) to a socket simultaneously. I keep getting the following exception :
java.net.SocketException: Software caused connection abort: socket write error

I initially start a thread that waits to read a serialized object from the socket input stream and then attempt to write an object across the socket- is this where the error is happening??

Do i need to read the object completely before i perform any writing to the socket, in other words keep everything in one thread??

Re: Concurrent socket read/write by threads

Posted By:   Zia_Mustefa  
Posted On:   Monday, April 21, 2003 10:46 AM

No, you dont have to read the object completly before writing to socket. May be your socket get closed while reading from the socket.
About | Sitemap | Contact