File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Socket Sending and Recieving at same Time?

 
Tony Combe
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 732
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic