File tree Expand file tree Collapse file tree 5 files changed +10
-0
lines changed
example_client_hello_world/src Expand file tree Collapse file tree 5 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ void ofApp::setup(){
55 ofBackground (0 );
66 ofSetLogLevel (OF_LOG_VERBOSE);
77 // basic connection:
8+ client.setWaitMillis (100 );
89 client.connect (" echo.websocket.org" );
910 // OR optionally use SSL
1011// client.connect("echo.websocket.org", true);
Original file line number Diff line number Diff line change @@ -104,5 +104,6 @@ namespace ofxLibwebsockets {
104104
105105 bool bShouldReconnect;
106106 uint64_t lastReconnectTime;
107+
107108 };
108109};
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ namespace ofxLibwebsockets {
3636 Connection (Reactor* const _reactor=NULL , Protocol* const _protocol=NULL );
3737
3838 ~Connection ();
39+
40+
3941 void close ();
4042 void send (const std::string& message);
4143
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ namespace ofxLibwebsockets {
4747
4848 unsigned int _http (struct libwebsocket *ws, const char * const url);
4949
50+ void setWaitMillis (int millis);
51+
5052 protected:
5153 std::string document_root;
5254 unsigned int waitMillis;
Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ namespace ofxLibwebsockets {
4141 return (idx < protocols.size ())? protocols[idx].second : NULL ;
4242 }
4343
44+ // --------------------------------------------------------------
45+ void Reactor::setWaitMillis (int millis){
46+ waitMillis = millis;
47+ }
4448 // --------------------------------------------------------------
4549 void Reactor::close (Connection* const conn){
4650 if (conn != NULL && conn->ws != NULL ){
You can’t perform that action at this time.
0 commit comments