From 9014bdfa3233dac70274b27eb40df3739b6f49eb Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 22 Jan 2015 22:49:37 +0100 Subject: cNetwork: Renamed callback to OnConnected() --- src/OSSupport/Network.h | 7 +++++-- src/OSSupport/TCPLinkImpl.cpp | 2 +- tests/Network/Google.cpp | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/OSSupport/Network.h b/src/OSSupport/Network.h index 85c7c5dcb..cdf6ba0e9 100644 --- a/src/OSSupport/Network.h +++ b/src/OSSupport/Network.h @@ -16,6 +16,10 @@ // fwd: class cTCPLink; typedef SharedPtr cTCPLinkPtr; +typedef std::vector cTCPLinkPtrs; +class cServerHandle; +typedef SharedPtr cServerHandlePtr; +typedef std::vector cServerHandlePtrs; @@ -118,7 +122,6 @@ public: /** Returns true if the server has been started correctly and is currently listening for incoming connections. */ virtual bool IsListening(void) const = 0; }; -typedef SharedPtr cServerHandlePtr; @@ -136,7 +139,7 @@ public: /** Called when the Connect call succeeds. Provides the newly created link that can be used for communication. */ - virtual void OnSuccess(cTCPLink & a_Link) = 0; + virtual void OnConnected(cTCPLink & a_Link) = 0; /** Called when the Connect call fails. */ virtual void OnError(int a_ErrorCode, const AString & a_ErrorMsg) = 0; diff --git a/src/OSSupport/TCPLinkImpl.cpp b/src/OSSupport/TCPLinkImpl.cpp index 5d31da22e..71b3d572d 100644 --- a/src/OSSupport/TCPLinkImpl.cpp +++ b/src/OSSupport/TCPLinkImpl.cpp @@ -213,7 +213,7 @@ void cTCPLinkImpl::EventCallback(bufferevent * a_BufferEvent, short a_What, void { if (Self->m_ConnectCallbacks != nullptr) { - Self->m_ConnectCallbacks->OnSuccess(*Self); + Self->m_ConnectCallbacks->OnConnected(*Self); // Reset the connect callbacks so that later errors get reported through the link callbacks: Self->m_ConnectCallbacks.reset(); return; diff --git a/tests/Network/Google.cpp b/tests/Network/Google.cpp index 8985eef17..2b8830c24 100644 --- a/tests/Network/Google.cpp +++ b/tests/Network/Google.cpp @@ -17,7 +17,7 @@ class cHTTPConnectCallbacks: public cNetwork::cConnectCallbacks { cEvent & m_Event; - virtual void OnSuccess(cTCPLink & a_Link) override + virtual void OnConnected(cTCPLink & a_Link) override { LOGD("Connected, sending HTTP GET"); if (!a_Link.Send("GET / HTTP/1.0\r\nHost:google.com\r\n\r\n")) -- cgit v1.2.3