aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Socket Sending and Recieving at same Time? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Socket Sending and Recieving at same Time?" Watch "Socket Sending and Recieving at same Time?" New topic
Author

Socket Sending and Recieving at same Time?

Tony Combe
Greenhorn

Joined: Mar 14, 2002
Posts: 17
Hello everyone I would like to know exactly what
would happen if a message was sent to a socket whilst a client was sending to the socket.
Would there be socket exceptions on both side (client and server) if so would it still be possible to recieve what was sent before the server tried to send or are both messages lost.
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
i dont se any problem with this.
usually a socket at either side will be endless loop listening for object or strings.
the same socket can write send also data at the same time.
Cindy Xu
Greenhorn

Joined: Apr 15, 2002
Posts: 6
There are two streams in a socket. One is InputStream for read, the other is OutputStream for write. So no exception is thrown.
Mirza Galib
Greenhorn

Joined: Jun 02, 2002
Posts: 12
There would be no exception thrown.But if u have problems related to what actually is going on then create two threads one for sending and one for receiving . pass the address of this socket in both the threads . Now using this u can handle what u are seding and receiving differently .


"Hain aur bhee duniya mein sukhanwar bahut acche.<br />Kehte hein ke Galib ka hai andaz-e-bayaan aur."
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Socket Sending and Recieving at same Time?