You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When LWIP RAW TCP connections are closed LWIP calls the data callback with a null pointer, so application code knows that socket is invalidated, and gets a chance to clear all references to it.
"If the remote host closes the connection, the callback function will be called with a NULL pbuf to indicate that fact." http://lwip.wikia.com/wiki/Raw/TCP
When a websocket connection is closed (either by the client or for conserving memory) there is no such warning. Any writes to a socket outside it's data callback, where it is guaranteed to be valid, may potentially write to a closed socket (or worse, freed).
This which limits application to a ping-pong polling scenario which, while it works lika a charm, is not exactly the spirit of websockets.
The text was updated successfully, but these errors were encountered:
When LWIP RAW TCP connections are closed LWIP calls the data callback with a null pointer, so application code knows that socket is invalidated, and gets a chance to clear all references to it.
"If the remote host closes the connection, the callback function will be called with a NULL pbuf to indicate that fact." http://lwip.wikia.com/wiki/Raw/TCP
When a websocket connection is closed (either by the client or for conserving memory) there is no such warning. Any writes to a socket outside it's data callback, where it is guaranteed to be valid, may potentially write to a closed socket (or worse, freed).
This which limits application to a ping-pong polling scenario which, while it works lika a charm, is not exactly the spirit of websockets.
The text was updated successfully, but these errors were encountered: