Need help improving a java client side port listener

前端 未结 2 1767
忘了有多久
忘了有多久 2021-01-23 03:06

I have a small bit of code that runs in an applet that contains SWING controls and is used to write information to a socket on a certain port and then listens for a response.

2条回答
  •  梦毁少年i
    2021-01-23 03:22

    All the network I/O should be in a separate thread.

    BTW readLine() returns null when the server closes the connection, not when it has finished sending data for the moment.

提交回复
热议问题