Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > ServerSocket and ClientSocket - bi-directional

Reply
Thread Tools

ServerSocket and ClientSocket - bi-directional

 
 
Abraham Khalil
Guest
Posts: n/a
 
      01-26-2004
A client can connect to a server socket and send message packets to
it.
Can the server socket respond back to the same client socket port, so
it's bi directional?

If so, an example logic would be appreciated

Thanks
 
Reply With Quote
 
 
 
 
Knute Johnson
Guest
Posts: n/a
 
      01-26-2004
Abraham Khalil wrote:
> A client can connect to a server socket and send message packets to
> it.
> Can the server socket respond back to the same client socket port, so
> it's bi directional?


Yes. Socket connections are bi-directional.

> If so, an example logic would be appreciated


Server
Create ServerSocket
Wait for connection
When connected
Open Output and InputStreams
Read and write data
When done
Close streams
Close socket

Client
Create socket
Connect to server
When connected
Open Output and InputStreams
Read and write data
When done
Close streams
Close socket

--

Knute Johnson
email s/nospam/knute/
Molon labe...

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
serversocket and proxy cod3nam3 Java 4 05-28-2008 07:37 AM
Borland ClientSocket gives memory leak (handle count increases) Heineken C++ 1 08-02-2007 02:04 PM
Need idea about client server connectivity (using ServerSocket and Socket) JPractitioner Java 3 02-16-2006 09:15 PM
Socket / ServerSocket & Remote Disconnection Detecting Jason Teagle Java 12 10-05-2003 10:23 AM
Restrict ports of ServerSocket.accept() sockets Thomas Kuhn Java 4 07-07-2003 08:49 AM



Advertisments