summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/TCPLinkImpl.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2015-03-09 22:39:11 +0100
committerHowaner <franzi.moos@googlemail.com>2015-03-09 22:39:11 +0100
commita96c21fc0d4326ffda93cc78c5dfcfc4bd034e24 (patch)
tree38dba8f86163283d90d1d6d9d2fa420cb4e99231 /src/OSSupport/TCPLinkImpl.h
parentReadded old comment (diff)
parentFixed client kick/crash if many block changes happend (diff)
downloadcuberite-a96c21fc0d4326ffda93cc78c5dfcfc4bd034e24.tar
cuberite-a96c21fc0d4326ffda93cc78c5dfcfc4bd034e24.tar.gz
cuberite-a96c21fc0d4326ffda93cc78c5dfcfc4bd034e24.tar.bz2
cuberite-a96c21fc0d4326ffda93cc78c5dfcfc4bd034e24.tar.lz
cuberite-a96c21fc0d4326ffda93cc78c5dfcfc4bd034e24.tar.xz
cuberite-a96c21fc0d4326ffda93cc78c5dfcfc4bd034e24.tar.zst
cuberite-a96c21fc0d4326ffda93cc78c5dfcfc4bd034e24.zip
Diffstat (limited to 'src/OSSupport/TCPLinkImpl.h')
-rw-r--r--src/OSSupport/TCPLinkImpl.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/OSSupport/TCPLinkImpl.h b/src/OSSupport/TCPLinkImpl.h
index 735e8ed9d..bea21aeff 100644
--- a/src/OSSupport/TCPLinkImpl.h
+++ b/src/OSSupport/TCPLinkImpl.h
@@ -94,6 +94,11 @@ protected:
Initialized in Enable(), cleared in Close() and EventCallback(RemoteClosed). */
cTCPLinkImplPtr m_Self;
+ /** If true, Shutdown() has been called and is in queue.
+ No more data is allowed to be sent via Send() and after all the currently buffered
+ data is sent to the OS TCP stack, the socket gets shut down. */
+ bool m_ShouldShutdown;
+
/** Creates a new link to be queued to connect to a specified host:port.
Used for outgoing connections created using cNetwork::Connect().
@@ -104,6 +109,9 @@ protected:
/** Callback that LibEvent calls when there's data available from the remote peer. */
static void ReadCallback(bufferevent * a_BufferEvent, void * a_Self);
+ /** Callback that LibEvent calls when the remote peer can receive more data. */
+ static void WriteCallback(bufferevent * a_BufferEvent, void * a_Self);
+
/** Callback that LibEvent calls when there's a non-data-related event on the socket. */
static void EventCallback(bufferevent * a_BufferEvent, short a_What, void * a_Self);
@@ -115,6 +123,10 @@ protected:
/** Updates m_RemoteIP and m_RemotePort based on the metadata read from the socket. */
void UpdateRemoteAddress(void);
+
+ /** Calls shutdown on the link and disables LibEvent writing.
+ Called after all data from LibEvent buffers is sent to the OS TCP stack and shutdown() has been called before. */
+ void DoActualShutdown(void);
};