Changeset - bf09edf74e7f
[Not reviewed]
0 1 0
Jan Kaluza - 10 years ago 2015-11-25 16:57:39
jkaluza@redhat.com
Forgot to actually call connectServer in previous commit..
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/WebSocketClient.cpp
Show inline comments
 
@@ -63,24 +63,25 @@ WebSocketClient::~WebSocketClient() {
 
void WebSocketClient::connectServer() {
 
	LOG4CXX_INFO(logger, "Starting DNS query for " << m_host << " " << m_path);
 
	m_dnsQuery = m_component->getNetworkFactories()->getDomainNameResolver()->createAddressQuery(m_host);
 
	m_dnsQuery->onResult.connect(boost::bind(&WebSocketClient::handleDNSResult, this, _1, _2));
 
	m_dnsQuery->run();
 
	m_reconnectTimer->stop();
 
}
 

	
 
void WebSocketClient::connectServer(const std::string &url) {
 
	std::string u = url.substr(6);
 
	m_host = u.substr(0, u.find("/"));
 
	m_path = u.substr(u.find("/"));
 
	connectServer();
 
}
 

	
 
void WebSocketClient::write(const std::string &data) {
 
	if (!m_conn) {
 
		return;
 
	}
 

	
 
	uint8_t opcode = 129; // UTF8
 
	if (data.empty()) {
 
		LOG4CXX_INFO(logger, "pong");
 
		opcode = 138; // PONG
 
	}
0 comments (0 inline, 0 general)