Android: Socket is closed

前端 未结 1 949
慢半拍i
慢半拍i 2021-01-28 18:23

PCClient :

public class PCServer
{

/**
 * @param args
 */
static Socket socket = null;
private static String ip = \"192.168.42.129\";
private s         


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

    Closing any stream obtained using getOutputStream() or getInputStream() closes the socket.

    Do you receive something before 'BZT' ? If so, the socket will be closed after you sent the empty answer.

    You should use only one output stream, and flush() each message without closing.

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