Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of WebSocketClient by
Revision 8:53d05ccff94a, committed 2015-02-14
- Comitter:
- komoritan
- Date:
- Sat Feb 14 00:28:52 2015 +0000
- Parent:
- 7:4567996414a5
- Commit message:
- Customized
Changed in this revision
Websocket.cpp | Show annotated file Show diff for this revision Revisions of this file |
Websocket.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Websocket.cpp Fri Feb 08 12:33:04 2013 +0000 +++ b/Websocket.cpp Sat Feb 14 00:28:52 2015 +0000 @@ -4,7 +4,7 @@ #define MAX_TRY_READ 10 //Debug is disabled by default -#if 0 +#if 1 #define DBG(x, ...) std::printf("[WebSocket : DBG]"x"\r\n", ##__VA_ARGS__); #define WARN(x, ...) std::printf("[WebSocket : WARN]"x"\r\n", ##__VA_ARGS__); #define ERR(x, ...) std::printf("[WebSocket : ERR]"x"\r\n", ##__VA_ARGS__); @@ -16,10 +16,17 @@ #define INFO(x, ...) printf("[WebSocket : INFO]"x"\r\n", ##__VA_ARGS__); +Websocket::Websocket(){ + socket.set_blocking(false, 400); +} Websocket::Websocket(char * url) { fillFields(url); socket.set_blocking(false, 400); } +void Websocket::set_server(char* url){ + fillFields(url); + socket.set_blocking(false, 400); +} void Websocket::fillFields(char * url) { int ret = parseURL(url, scheme, sizeof(scheme), host, sizeof(host), &port, path, sizeof(path));
--- a/Websocket.h Fri Feb 08 12:33:04 2013 +0000 +++ b/Websocket.h Sat Feb 14 00:28:52 2015 +0000 @@ -74,6 +74,9 @@ * @param url The Websocket url in the form "ws://ip_domain[:port]/path" (by default: port = 80) */ Websocket(char * url); + Websocket(); + + void set_server(char * url); /** * Connect to the websocket url