We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1998ae commit cb92ac1Copy full SHA for cb92ac1
websocket-rails-client/websocket_rails.cpp
@@ -43,7 +43,7 @@ std::string WebsocketRails::connect() {
43
this->conn = new WebsocketConnection(this->url, *this);
44
this->websocket_connection_thread = boost::thread(&WebsocketConnection::run, this->conn);
45
int count = 0;
46
- while(this->connectionStale()) {
+ while(!this->isConnected()) {
47
boost::posix_time::seconds workTime(1);
48
boost::this_thread::sleep(workTime);
49
count++;
@@ -57,7 +57,9 @@ std::string WebsocketRails::connect() {
57
58
std::string WebsocketRails::disconnect() {
59
if(this->conn != 0) {
60
- this->conn->close();
+ if(this->isConnected()) {
61
+ this->conn->close();
62
+ }
63
this->websocket_connection_thread.join();
64
delete this->conn;
65
}
0 commit comments