944,083 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1200
  • Java RSS
May 5th, 2006
0

client and server communication

Expand Post »
hi,

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

thanks
Similar Threads
Reputation Points: 10
Solved Threads: 1
Posting Whiz
sam1 is offline Offline
300 posts
since Nov 2004
May 6th, 2006
0

Re: client and server communication

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).
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
May 6th, 2006
0

Re: client and server communication

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);
Reputation Points: 92
Solved Threads: 51
Practically a Posting Shark
Phaelax is offline Offline
856 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Downloading files from websites
Next Thread in Java Forum Timeline: can anyone help about j2me





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC