diff options
author | Mattes D <github@xoft.cz> | 2015-01-09 11:20:19 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-01-22 20:12:41 +0100 |
commit | b8b3409b74e93dd7d1e87f60f498c724e5374f26 (patch) | |
tree | aa8544f87dabc26e4b4cab1c130051035e6c00c3 /src/OSSupport/Network.h | |
parent | Implemented LibEvent-based client connections. (diff) | |
download | cuberite-b8b3409b74e93dd7d1e87f60f498c724e5374f26.tar cuberite-b8b3409b74e93dd7d1e87f60f498c724e5374f26.tar.gz cuberite-b8b3409b74e93dd7d1e87f60f498c724e5374f26.tar.bz2 cuberite-b8b3409b74e93dd7d1e87f60f498c724e5374f26.tar.lz cuberite-b8b3409b74e93dd7d1e87f60f498c724e5374f26.tar.xz cuberite-b8b3409b74e93dd7d1e87f60f498c724e5374f26.tar.zst cuberite-b8b3409b74e93dd7d1e87f60f498c724e5374f26.zip |
Diffstat (limited to 'src/OSSupport/Network.h')
-rw-r--r-- | src/OSSupport/Network.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/OSSupport/Network.h b/src/OSSupport/Network.h index 447cd457b..5cca511dc 100644 --- a/src/OSSupport/Network.h +++ b/src/OSSupport/Network.h @@ -22,6 +22,9 @@ public: class cCallbacks { public: + // Force a virtual destructor for all descendants: + virtual ~cCallbacks() {} + /** Called when there's data incoming from the remote peer. */ virtual void OnReceivedData(cTCPLink & a_Link, const char * a_Data, size_t a_Length) = 0; @@ -36,6 +39,9 @@ public: typedef SharedPtr<cCallbacks> cCallbacksPtr; + // Force a virtual destructor for all descendants: + virtual ~cTCPLink() {} + /** Queues the specified data for sending to the remote peer. Returns true on success, false on failure. Note that this success or failure only reports the queue status, not the actual data delivery. */ virtual bool Send(const void * a_Data, size_t a_Length) = 0; @@ -86,6 +92,9 @@ class cServerHandle friend class cNetwork; public: + // Force a virtual destructor for all descendants: + virtual ~cServerHandle() {} + /** Stops the server, no more incoming connections will be accepted. */ virtual void Close(void) = 0; @@ -105,6 +114,9 @@ public: class cConnectCallbacks { public: + // Force a virtual destructor for all descendants: + virtual ~cConnectCallbacks() {} + /** Called when the Connect call succeeds. Provides the newly created link that can be used for communication. */ virtual void OnSuccess(cTCPLink & a_Link) = 0; @@ -119,6 +131,9 @@ public: class cListenCallbacks { public: + // Force a virtual destructor for all descendants: + virtual ~cListenCallbacks() {} + /** 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; @@ -130,6 +145,9 @@ public: class cResolveNameCallbacks { public: + // Force a virtual destructor for all descendants: + virtual ~cResolveNameCallbacks() {} + /** Called when the hostname is successfully resolved into an IP address. */ virtual void OnNameResolved(const AString & a_Name, const AString & a_IP) = 0; |