Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP,Java server(1.1.8) and c++ client using tcp/ip

Status
Not open for further replies.

rubio102

Programmer
Mar 20, 2001
2
SE
Hi,

i have a big problem. I have a Java-server that communicates with at c++ implemented client. The Java-server writes "HI" as soon it gets a connection with a client. The client get conected to the java-server but it gets never the string "Hi". It's no problem when the client is a java-client! I use the following code to print "HI":

private void println(String s, boolean flush) throws IOException
{
out.write(s.getBytes());
out.write("\r\n".getBytes());
if (flush)
out.flush();
}
out is a PrintStream class. I used before PrintWriter and i get the same problem but not with the same high frequency.

I know that the class PrintStream uses a native method in the
bottom:

SocketOutPutStream.socketWrite(byte[ ],int,int)

best regards
Alvaro e-mail:alvaror@mwm.se
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top