lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] How to check connection


From: Danil Kaykov
Subject: [lwip-users] How to check connection
Date: Tue, 28 Jun 2016 17:41:54 +0600
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1

Hi all.

I need correct way to check state of the connection, and if it is aborted/disconnected/etc, reconnect.


Now I do it with the help of test sending some data.

In a separate thread ...

for( ;; )
  {

// check connection...

    /*while(netconn_write(conn, (void*)"1", 2, NETCONN_COPY)!=ERR_OK)
    {
       err = netconn_connect(conn, &DestIPaddr, 8080);
       if(err!=ERR_OK) continue;
    }*/
     
    if (netconn_recv_tcp_pbuf(conn, &pbuf) == ERR_OK)          
     {

                // some processing....

                pbuf_free(pbuf);
     }

}


reply via email to

[Prev in Thread] Current Thread [Next in Thread]