add isEnabledAutomaticReconnection (#75)
* add isEnabledAutomaticReconnection * test isEnabledAutomaticReconnection * rename
This commit is contained in:
		
				
					committed by
					
						
						Benjamin Sergeant
					
				
			
			
				
	
			
			
			
						parent
						
							e2acbe8499
						
					
				
				
					commit
					751f294164
				
			@@ -458,6 +458,11 @@ namespace ix
 | 
				
			|||||||
        _automaticReconnection = false;
 | 
					        _automaticReconnection = false;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    bool WebSocket::isAutomaticReconnectionEnabled() const
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return _automaticReconnection;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    size_t WebSocket::bufferedAmount() const
 | 
					    size_t WebSocket::bufferedAmount() const
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        return _ws.bufferedAmount();
 | 
					        return _ws.bufferedAmount();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -134,6 +134,7 @@ namespace ix
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        void enableAutomaticReconnection();
 | 
					        void enableAutomaticReconnection();
 | 
				
			||||||
        void disableAutomaticReconnection();
 | 
					        void disableAutomaticReconnection();
 | 
				
			||||||
 | 
					        bool isAutomaticReconnectionEnabled() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private:
 | 
					    private:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -96,6 +96,12 @@ namespace
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        _webSocket.enableAutomaticReconnection();
 | 
				
			||||||
 | 
					        REQUIRE(_webSocket.isAutomaticReconnectionEnabled() == true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        _webSocket.disableAutomaticReconnection();
 | 
				
			||||||
 | 
					        REQUIRE(_webSocket.isAutomaticReconnectionEnabled() == false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Start the connection
 | 
					        // Start the connection
 | 
				
			||||||
        _webSocket.start();
 | 
					        _webSocket.start();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user