This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Socket Sending and Recieving at same Time?

 
Tony Combe
Greenhorn
Posts: 17
  • 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
  • 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
  • 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
  • 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 .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic