Communication Java(Client) with Python(Server)

后端 未结 1 1102
-上瘾入骨i
-上瘾入骨i 2021-01-28 20:23

I am doing a simple Java Client application which should communicate with Python Server. I can easily send a string to Python Server and print it in console, but when i\'m tryin

相关标签:
1条回答
  • 2021-01-28 21:01

    The JavaDoc of DataOutputStream#writeUTF(...) says:

    First, two bytes are written to the output stream as if by the writeShort method giving the number of bytes to follow

    In you python code your data value will be prefixed with two bytes for the length of the string to follow.

    0 讨论(0)
提交回复
热议问题