[英]Java: DataOutputStream through socket is wrong on other side (which is Python)
我有一个Socket
, s
和long
, 1312992
。
DataOutputStream out = new DataOutputStream(s.getOutputStream());
out.writeLong(hwnd);
out.flush();
在做
self.hwnd, = struct.unpack('!Q', self.appletconn.recv(8))
print(self.hwnd)
在(python)接收端打印51
。 我认为我的发送代码有问题。
谢谢。
使用数据包捕获工具(如tcpdump或Wireshark),检查线路上的状况。 我猜,您可能在发送和/或接收端混合了文本和二进制文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.