search

Home  >  Q&A  >  body text

objective-c - app与设备进行socket 连接后, 设备切换了信道,这时socket会断开吗

app与设备进行socket 连接后,进行tcp 通信, 设备切换了信道,这时socket会断开吗

天蓬老师天蓬老师2753 days ago920

reply all(1)I'll reply

  • 滿天的星座

    滿天的星座2017-05-02 09:36:51

    Although protocols such as TCP look a bit like making a phone call, at the bottom level, communication is still delivered in the form of data packets like letters.
    In other words, the communication between the App and the device is nothing more than writing letters to each other. Then if one of them performs a moving activity such as switching channels, as long as the other party is notified of the new address in time, it will not have a big impact on the communication between them. In addition, the TCP protocol itself has a compensation mechanism, and lost letters can be resent to new addresses smoothly.
    However, there is a more critical content here, which is that the device can or supports notifying the other party in time when switching channels. If you cannot or simply do not want to maintain the original connection, then the Socket will naturally be disconnected.

    reply
    0
  • Cancelreply