[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Issue with netconn_close closing connection before netc
From: |
Terry Barnaby |
Subject: |
Re: [lwip-users] Issue with netconn_close closing connection before netconn_write's have completed |
Date: |
Thu, 23 May 2019 07:18:44 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 21/05/2019 13:55, ricardoschoof wrote:
Dear Terry,
This morning I started a similar thread:
http://lwip.100.n7.nabble.com/Socket-Connection-closed-before-sending-all-data-td34503.html,
except I use sockets instead of netconn.
Did you manage to find a solution for your problem?
--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users
No I haven't found a proper solution to the problem. Adding a short
delay (1ms) between my last netconn_write() and the netconn_close()
works around the issue.
while(1){
// Accept any incoming connection
accept_err = netconn_accept(osocketListen, &osocket);
if(accept_err == ERR_OK){
dl4printf("Listen: accept connection\n");
netconn_set_recvtimeout(osocket, 10000);
// Serve connection
err = processRequest();
// We shouldn't need this but TCP write packets can be lost
if we don't for some reason
delayMs(1);
// Close connection
netconn_close(osocket);
// Delete connection
netconn_delete(osocket);
osocket = 0;
}
}