UDP Packet content changes while transmitting

前端 未结 2 1062
甜味超标
甜味超标 2021-01-27 15:04

I\'m programming an Server-Client Software, where the client connects to the server with an port request, the server opens a new port and sends back the new port number. Then th

2条回答
  •  一整个雨季
    2021-01-27 15:51

    You are sending a string of one size, yet on the other side you are reading the string of 1024 bytes - which you never sent. This will not do. You should either serialize string using serialize() method, or, if you want to send raw string bytes, send string length as a separate part of the message.

提交回复
热议问题