1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00
libwebsockets/minimal-examples/ws-client
Andy Green edd7efd43d client: libuv: fix close handling during redirect
During client redirect we "reset" the wsi to the redirect address,
involving closing the current fd that was told to redirect (it will
usually be a completely different server or port).

With libuv and its two-stage close that's not trivial.  This solves
the problem we will "reset" (overwrite) where the handle lives in the
wsi with new a new connection / handle by having it copied out into
an allocated watcher struct, which is freed in the uv close callback.

To confirm it the minimal ws client example gets some new options, the
original problem was replicated with this

$ lws-minimal-ws-client-echo -s invalid.url.com -p 80

https://github.com/warmcat/libwebsockets/issues/1390
2018-09-11 18:27:59 +08:00
..
minimal-ws-client-echo client: libuv: fix close handling during redirect 2018-09-11 18:27:59 +08:00
minimal-ws-client-ping minimal: adapt for ping test over https 2018-08-20 07:44:20 +08:00
minimal-ws-client-pmd-bulk libwebsockets.h: clean out some boilerplate better put in core/private.h 2018-08-16 19:10:32 +08:00
minimal-ws-client-rx refactor: most preparation for -DLWS_ROLE_H1=0 2018-04-27 19:16:50 +08:00
minimal-ws-client-tx refactor: most preparation for -DLWS_ROLE_H1=0 2018-04-27 19:16:50 +08:00
README.md autobahn fixes 2018-04-22 06:45:46 +08:00

name demonstrates
minimal-ws-client-echo Simple client that connects to a ws server and echos anything the server sends
minimal-ws-client-pmd-bulk Client that sends bulk multifragment data to the minimal-ws-server-pmd-bulk example
minimal-ws-client-rx Connects to the dumb-increment-protocol wss server at https://libwebsockets.org and demonstrates receiving ws data
minimal-ws-client-tx Connects to the minimal-ws-broker example as a publisher, demonstrating sending ws data