Java client and a C++ server send and receive via TCP Socket

后端 未结 3 499
渐次进展
渐次进展 2021-01-05 17:09

I have a C++ server and two clients (ruby and java). Everything is running on a 64-bit linux-machine (java 1.7.0_17) The ruby client is fully working, but the java version m

3条回答
  •  广开言路
    2021-01-05 17:38

    PrintWriter buffer (when autoflush is true) is only flushed by calling println or printf. Calling print may not flush the buffer (Javadoc). Try calling println or use a OutputStreamWriter directly and flush(). Be aware of using the right charset (You can set it up in OutputStreamWriter constructor).

提交回复
热议问题