hi,

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

thanks

Recommended Answers

All 2 Replies

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.