face: Fix bug when TcpChannel::handleSuccessfulConnect seem to be called before channel is acutally connected
Change-Id: Ibf50da48f01137649ffd90e8f6d16c4f03c87a2b
Refs: #1344
diff --git a/daemon/face/tcp-channel.cpp b/daemon/face/tcp-channel.cpp
index 616ca62..35ade3b 100644
--- a/daemon/face/tcp-channel.cpp
+++ b/daemon/face/tcp-channel.cpp
@@ -61,14 +61,6 @@
shared_ptr<monotonic_deadline_timer> connectTimeoutTimer =
make_shared<monotonic_deadline_timer>(boost::ref(getGlobalIoService()));
- clientSocket->open(m_localEndpoint.protocol());
-
- // The following does not work and CCNx does not bind the local
- // socket to a fixed port number for TCP connections
-
- // clientSocket->set_option(ip::tcp::socket::reuse_address(true));
- // clientSocket->bind(m_localEndpoint);
-
clientSocket->async_connect(remoteEndpoint,
bind(&TcpChannel::handleSuccessfulConnect, this, _1,
clientSocket, connectTimeoutTimer,
@@ -92,14 +84,6 @@
shared_ptr<monotonic_deadline_timer> connectTimeoutTimer =
make_shared<monotonic_deadline_timer>(boost::ref(getGlobalIoService()));
- clientSocket->open(m_localEndpoint.protocol());
-
- // The following does not work and CCNx does not bind the local
- // socket to a fixed port number for TCP connections
-
- // clientSocket->set_option(ip::tcp::socket::reuse_address(true));
- // clientSocket->bind(m_localEndpoint);
-
ip::tcp::resolver::query query(remoteHost, remotePort);
shared_ptr<ip::tcp::resolver> resolver =
make_shared<ip::tcp::resolver>(boost::ref(getGlobalIoService()));