954,180 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

client and server communication

hi,

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

thanks

sam1
Posting Whiz
300 posts since Nov 2004
Reputation Points: 10
Solved Threads: 1
 

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).

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

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);

Phaelax
Practically a Posting Shark
858 posts since Mar 2004
Reputation Points: 92
Solved Threads: 51
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You