summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/OSSupport/Network.cpp5
-rw-r--r--src/OSSupport/Network.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/src/OSSupport/Network.cpp b/src/OSSupport/Network.cpp
index af63c75d0..4dc8d1df1 100644
--- a/src/OSSupport/Network.cpp
+++ b/src/OSSupport/Network.cpp
@@ -841,6 +841,10 @@ cServerHandleImplPtr cServerHandleImpl::Listen(
{
cNetworkSingleton::Get().AddServer(res);
}
+ else
+ {
+ a_ListenCallbacks->OnError(res->m_ErrorCode, res->m_ErrorMsg);
+ }
return res;
}
@@ -1062,6 +1066,7 @@ cTCPLink::cTCPLink(cCallbacksPtr a_Callbacks):
+
////////////////////////////////////////////////////////////////////////////////
// cNetworkSingleton:
diff --git a/src/OSSupport/Network.h b/src/OSSupport/Network.h
index 11c45b152..cb5badaeb 100644
--- a/src/OSSupport/Network.h
+++ b/src/OSSupport/Network.h
@@ -139,6 +139,9 @@ public:
/** Called when the TCP server created with Listen() accepts an incoming connection.
Provides the newly created Link that can be used for communication. */
virtual void OnAccepted(cTCPLink & a_Link) = 0;
+
+ /** Called when the socket fails to listen on the specified port. */
+ virtual void OnError(int a_ErrorCode, const AString & a_ErrorMsg) = 0;
};
typedef SharedPtr<cListenCallbacks> cListenCallbacksPtr;