Debug Version
Fork of WebSocketClient by
Diff: Websocket.cpp
- Revision:
- 8:53d05ccff94a
- Parent:
- 7:4567996414a5
--- 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));