diff options
Diffstat (limited to 'src/DirectConnection.cpp')
-rw-r--r-- | src/DirectConnection.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/DirectConnection.cpp b/src/DirectConnection.cpp index 3ffff22..8243b50 100644 --- a/src/DirectConnection.cpp +++ b/src/DirectConnection.cpp @@ -77,7 +77,7 @@ namespace sibs // For better performance, modify HKLM\System\CurrentControlSet\Services\Afd\Parameters\FastSendDatagramThreshold #ifdef WIN32 int mss = 1052; - UDT::setsockopt(socket, 0, UDT_MSS, &mss, sizeof(mss)); + UDT::setsockopt(udtSocket, 0, UDT_MSS, &mss, sizeof(mss)); #endif if(rendezvous || bind) @@ -153,16 +153,16 @@ namespace sibs catch(SocketCreateException &e) { if(connectCallbackFunc) - connectCallbackFunc(peer, PubSubResult::ERROR, e.what()); - return PubSubConnectResult { peer, PubSubResult::ERROR, e.what() }; + connectCallbackFunc(peer, PubSubResult::RESULT_ERROR, e.what()); + return PubSubConnectResult { peer, PubSubResult::RESULT_ERROR, e.what() }; } Log::debug("DirectConnections: Connecting to peer (ip: %s, port: %d, rendezvous: %s)", address.getAddress().c_str(), address.getPort(), rendezvous ? "yes" : "no"); if(UDT::connect(socket->udtSocket, (sockaddr*)&address.address, sizeof(address.address)) == UDT::ERROR) { if(connectCallbackFunc) - connectCallbackFunc(peer, PubSubResult::ERROR, UDT::getlasterror_desc()); - return PubSubConnectResult{ peer, PubSubResult::ERROR, UDT::getlasterror_desc() }; + connectCallbackFunc(peer, PubSubResult::RESULT_ERROR, UDT::getlasterror_desc()); + return PubSubConnectResult{ peer, PubSubResult::RESULT_ERROR, UDT::getlasterror_desc() }; } UDT::epoll_add_usock(eid, socket->udtSocket); @@ -175,8 +175,8 @@ namespace sibs peersMutex.unlock(); if(connectCallbackFunc) - connectCallbackFunc(peer, PubSubResult::OK, ""); - return PubSubConnectResult { peer, PubSubResult::OK, "" }; + connectCallbackFunc(peer, PubSubResult::RESULT_OK, ""); + return PubSubConnectResult { peer, PubSubResult::RESULT_OK, "" }; }); connectionResultsMutex.unlock(); } @@ -199,10 +199,10 @@ namespace sibs if(sentSize == UDT::ERROR) { if(sendDataCallbackFunc) - sendDataCallbackFunc(PubSubResult::ERROR, UDT::getlasterror_desc()); + sendDataCallbackFunc(PubSubResult::RESULT_ERROR, UDT::getlasterror_desc()); } else if(sendDataCallbackFunc) - sendDataCallbackFunc(PubSubResult::OK, ""); + sendDataCallbackFunc(PubSubResult::RESULT_OK, ""); }).detach(); return true; } |