[Libwebsockets] How to cleanly disconnect and reconnect

Deric Panet-Raymond dpraymond at satcomdirect.com
Tue Apr 21 23:41:12 CEST 2015

I’m trying to modify our application to use a connect, send data, ack data, then disconnect sequence.  Our connection is unreliable in our application and also changes from one interface to another often, to make the app more robust we want to tear down the connection and bring it back up again when we need to send data.  I have a version working, but I appear to have a Memory Leak, I can’t pinpoint where, but it’s generated everytime we close and re-open the connection and I wonder if I’m not cleaning up the connection properly.

I have added a check for a close_connection variable that get’s set once we’ve received our current data, which returns –1 from the socket callback handler, but I’m still leaking that memory.

Any suggestions would be greatly appreciated.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20150421/2af0ab81/attachment.html>

More information about the Libwebsockets mailing list