服务器OnExecute事件,如
try
s := AContext.Connection.IOHandler.ReadLn(IndyTextEncoding_UTF8);
ok:=true;
except
on e:exception do winapi.windows.beep(500,500);
end;
基本问题是从客户端发送到服务器
答案 0 :(得分:3)
我通过在java代码
中的字符串末尾添加LF字符来解决它 String str = "Test\n";
try {
socket = new Socket("localhost", 13428);
osw =new OutputStreamWriter(socket.getOutputStream(), "UTF-8");
osw.write( str, 0, str.length());
osw.flush();
} catch (IOException e) {
System.err.print(e);
} finally {
socket.close();
}