ESP8266 Developer Zone The Official ESP8266 Forum 2016-07-10T02:26:14+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=2414 2016-07-10T02:26:14+08:00 2016-07-10T02:26:14+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2414&p=7885#p7885 <![CDATA[Stopping TCP server correct way]]>

Code:

   _iRes = espconn_get_connection_info(&httpdSvr, &_clientConn, 0);
   if (_iRes == ESPCONN_OK){
      // disconnect all
      int _i;
      for (_i = httpdSvr.link_cnt -1; _i >= 0; _i--){
         memcpy(httpdSvr.proto.tcp->remote_ip, _clientConn[_i].remote_ip, 4);
         httpdSvr.proto.tcp->remote_port = _clientConn[_i].remote_port;
         _iRes = espconn_abort(&httpdSvr);  // abort called instead "espconn_disconnect" to force disconnect socket
      }
      _iRes = espconn_delete(&httpdSvr);
      if (_iRes != ESPCONN_OK){
         if (_iRes == ESPCONN_INPROGRESS) //
           os_printf("TCP server connection in progress");
   }


problem here is that on "espconn_delete()" I am getting error ESPCONN_INPROGRESS. Is there any way to "force" stop listening and to disable TCP server?

Rgds,
Frenk

Statistics: Posted by FrenkR — Sun Jul 10, 2016 2:26 am


]]>