diff --git a/SAM.cpp b/SAM.cpp index 5dbb106f..e834659c 100644 --- a/SAM.cpp +++ b/SAM.cpp @@ -59,6 +59,7 @@ namespace stream default: ; } + m_Socket.close (); delete this; } @@ -447,7 +448,7 @@ namespace stream { LogPrint ("SAM stream read error: ", ecode.message ()); if (ecode != boost::asio::error::operation_aborted) - Terminate (); + m_Socket.get_io_service ().post (boost::bind (&SAMSocket::Terminate, this)); } else { diff --git a/SAM.h b/SAM.h index 79d334ae..97d51757 100644 --- a/SAM.h +++ b/SAM.h @@ -21,7 +21,7 @@ namespace stream const int SAM_CONNECT_TIMEOUT = 5; // in seconds const int SAM_NAMING_LOOKUP_TIMEOUT = 5; // in seconds const char SAM_HANDSHAKE[] = "HELLO VERSION"; - const char SAM_HANDSHAKE_REPLY[] = "HELLO REPLY RESULT=OK VERSION=3.1\n"; + const char SAM_HANDSHAKE_REPLY[] = "HELLO REPLY RESULT=OK VERSION=3.0\n"; const char SAM_SESSION_CREATE[] = "SESSION CREATE"; const char SAM_SESSION_CREATE_REPLY_OK[] = "SESSION STATUS RESULT=OK DESTINATION=%s\n"; const char SAM_SESSION_CREATE_DUPLICATED_ID[] = "SESSION STATUS RESULT=DUPLICATED_ID\n";