From 39641f05b94a8dcc1701202570c6688363741f34 Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 26 Mar 2015 11:15:29 -0400 Subject: [PATCH] create datagram destination for DATAGRAM session --- SAM.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/SAM.cpp b/SAM.cpp index 04826623..41499dd5 100644 --- a/SAM.cpp +++ b/SAM.cpp @@ -253,16 +253,15 @@ namespace client if (m_Session) { m_SocketType = eSAMSocketTypeSession; - if (m_Session->localDestination->IsReady ()) + if (style == SAM_VALUE_DATAGRAM) { - if (style == SAM_VALUE_DATAGRAM) - { - auto dest = m_Session->localDestination->CreateDatagramDestination (); - dest->SetReceiver (std::bind (&SAMSocket::HandleI2PDatagramReceive, shared_from_this (), - std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5)); - } - SendSessionCreateReplyOk (); + auto dest = m_Session->localDestination->CreateDatagramDestination (); + dest->SetReceiver (std::bind (&SAMSocket::HandleI2PDatagramReceive, shared_from_this (), + std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5)); } + + if (m_Session->localDestination->IsReady ()) + SendSessionCreateReplyOk (); else { m_Timer.expires_from_now (boost::posix_time::seconds(SAM_SESSION_READINESS_CHECK_INTERVAL));