Skip to content

Commit 28d719a

Browse files
committed
Merge pull request #11 from LittleLittle/connect
Avoid duplicated connection event for default namespace.
2 parents 035ad01 + c96f72c commit 28d719a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/sio_socket.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,10 @@ namespace sio
265265
void socket::impl::send_connect()
266266
{
267267
NULL_GUARD(m_client);
268-
packet p(packet::type_connect,m_nsp);
269-
m_client->send(p);
268+
if(m_nsp!="/") {
269+
packet p(packet::type_connect,m_nsp);
270+
m_client->send(p);
271+
}
270272
m_connection_timer.reset(new boost::asio::deadline_timer(m_client->get_io_service()));
271273
boost::system::error_code ec;
272274
m_connection_timer->expires_from_now(boost::posix_time::milliseconds(20000), ec);

0 commit comments

Comments
 (0)