client and server communication

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2004
Posts: 259
Reputation: sam1 is an unknown quantity at this point 
Solved Threads: 1
sam1's Avatar
sam1 sam1 is offline Offline
Posting Whiz in Training

client and server communication

 
0
  #1
May 5th, 2006
hi,

can a server and client application communicate using strings. for example say server sends ok and error for each request received.......

thanks
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: client and server communication

 
0
  #2
May 6th, 2006
depending on what you mean by "send", of course.
That's pretty much how 99% of network protocols work (simplified of course, the actual stuff that's sent is a lot more complex in many cases).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 802
Reputation: Phaelax is on a distinguished road 
Solved Threads: 40
Phaelax Phaelax is offline Offline
Practically a Posting Shark

Re: client and server communication

 
0
  #3
May 6th, 2006
That's how AOL's protocol (TOC) works.

String msg = "this is a message";

//write it out
out.writeBytes(msg);

//recipient reading back in
byte[] bytes = new byte[in.available()];
in.readFully(bytes);

String incoming = new String(bytes);
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1104 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC