簡體   English   中英

Java:另一端通過套接字的DataOutputStream錯誤(Python)

[英]Java: DataOutputStream through socket is wrong on other side (which is Python)

我有一個Socketslong1312992

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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM