Skip to content

Commit b425c97

Browse files
Merge
2 parents f18a79f + 8deec09 commit b425c97

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

example_client_hello_world/src/ofApp.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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);

libs/ofxLibwebsockets/include/ofxLibwebsockets/Client.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,6 @@ namespace ofxLibwebsockets {
104104

105105
bool bShouldReconnect;
106106
uint64_t lastReconnectTime;
107+
107108
};
108109
};

libs/ofxLibwebsockets/include/ofxLibwebsockets/Connection.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

libs/ofxLibwebsockets/include/ofxLibwebsockets/Reactor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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;

libs/ofxLibwebsockets/src/Reactor.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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){

0 commit comments

Comments
 (0)