Java TCP socket: data transfer is slow

后端 未结 12 1941
误落风尘
误落风尘 2020-12-01 09:50

I set up a server with a ServerSocket, connect to it with a client machine. They\'re directly networked through a switch and the ping time is <1ms.

Now, I try to

12条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 10:21

    Maybe you should try sending ur data in chunks(frames) instead of writing each byte seperately. And align your frames with the TCP packet size for best performance.

提交回复
热议问题