summaryrefslogtreecommitdiffstats
path: root/source/OSSupport/ListenThread.h
diff options
context:
space:
mode:
authorAlexander Harkness <bearbin@gmail.com>2013-07-29 13:13:03 +0200
committerAlexander Harkness <bearbin@gmail.com>2013-07-29 13:13:03 +0200
commit53e22b11857fed62e2313d6d84d90f88ed412ffb (patch)
treec61e56725da7dff0154d566722651e2c39c9d6c6 /source/OSSupport/ListenThread.h
parentWebAdmin: Removed the duplicate memory usage querying (diff)
downloadcuberite-53e22b11857fed62e2313d6d84d90f88ed412ffb.tar
cuberite-53e22b11857fed62e2313d6d84d90f88ed412ffb.tar.gz
cuberite-53e22b11857fed62e2313d6d84d90f88ed412ffb.tar.bz2
cuberite-53e22b11857fed62e2313d6d84d90f88ed412ffb.tar.lz
cuberite-53e22b11857fed62e2313d6d84d90f88ed412ffb.tar.xz
cuberite-53e22b11857fed62e2313d6d84d90f88ed412ffb.tar.zst
cuberite-53e22b11857fed62e2313d6d84d90f88ed412ffb.zip
Diffstat (limited to 'source/OSSupport/ListenThread.h')
-rw-r--r--source/OSSupport/ListenThread.h166
1 files changed, 83 insertions, 83 deletions
diff --git a/source/OSSupport/ListenThread.h b/source/OSSupport/ListenThread.h
index c29140ed3..4e337d814 100644
--- a/source/OSSupport/ListenThread.h
+++ b/source/OSSupport/ListenThread.h
@@ -1,83 +1,83 @@
-
-// ListenThread.h
-
-// Declares the cListenThread class representing the thread that listens for client connections
-
-
-
-
-
-#pragma once
-
-#include "IsThread.h"
-#include "Socket.h"
-
-
-
-
-
-// fwd:
-class cServer;
-
-
-
-
-
-class cListenThread :
- public cIsThread
-{
- typedef cIsThread super;
-
-public:
- /// Used as the callback for connection events
- class cCallback
- {
- public:
- /// This callback is called whenever a socket connection is accepted
- virtual void OnConnectionAccepted(cSocket & a_Socket) = 0;
- } ;
-
- cListenThread(cCallback & a_Callback, cSocket::eFamily a_Family, const AString & a_ServiceName = "");
- ~cListenThread();
-
- /// Creates all the sockets, returns trus if successful, false if not.
- bool Initialize(const AString & a_PortsString);
-
- bool Start(void);
-
- void Stop(void);
-
- /// Call before Initialize() to set the "reuse" flag on the sockets
- void SetReuseAddr(bool a_Reuse = true);
-
-protected:
- typedef std::vector<cSocket> cSockets;
-
- /// The callback which to notify of incoming connections
- cCallback & m_Callback;
-
- /// Socket address family to use
- cSocket::eFamily m_Family;
-
- /// Sockets that are being monitored
- cSockets m_Sockets;
-
- /// If set to true, the SO_REUSEADDR socket option is set to true
- bool m_ShouldReuseAddr;
-
- /// Name of the service that's listening on the ports; for logging purposes only
- AString m_ServiceName;
-
-
- /** Fills in m_Sockets with individual sockets, each for one port specified in a_PortsString.
- Returns true if successful and at least one socket has been created
- */
- bool CreateSockets(const AString & a_PortsString);
-
- // cIsThread override:
- virtual void Execute(void) override;
-} ;
-
-
-
-
+
+// ListenThread.h
+
+// Declares the cListenThread class representing the thread that listens for client connections
+
+
+
+
+
+#pragma once
+
+#include "IsThread.h"
+#include "Socket.h"
+
+
+
+
+
+// fwd:
+class cServer;
+
+
+
+
+
+class cListenThread :
+ public cIsThread
+{
+ typedef cIsThread super;
+
+public:
+ /// Used as the callback for connection events
+ class cCallback
+ {
+ public:
+ /// This callback is called whenever a socket connection is accepted
+ virtual void OnConnectionAccepted(cSocket & a_Socket) = 0;
+ } ;
+
+ cListenThread(cCallback & a_Callback, cSocket::eFamily a_Family, const AString & a_ServiceName = "");
+ ~cListenThread();
+
+ /// Creates all the sockets, returns trus if successful, false if not.
+ bool Initialize(const AString & a_PortsString);
+
+ bool Start(void);
+
+ void Stop(void);
+
+ /// Call before Initialize() to set the "reuse" flag on the sockets
+ void SetReuseAddr(bool a_Reuse = true);
+
+protected:
+ typedef std::vector<cSocket> cSockets;
+
+ /// The callback which to notify of incoming connections
+ cCallback & m_Callback;
+
+ /// Socket address family to use
+ cSocket::eFamily m_Family;
+
+ /// Sockets that are being monitored
+ cSockets m_Sockets;
+
+ /// If set to true, the SO_REUSEADDR socket option is set to true
+ bool m_ShouldReuseAddr;
+
+ /// Name of the service that's listening on the ports; for logging purposes only
+ AString m_ServiceName;
+
+
+ /** Fills in m_Sockets with individual sockets, each for one port specified in a_PortsString.
+ Returns true if successful and at least one socket has been created
+ */
+ bool CreateSockets(const AString & a_PortsString);
+
+ // cIsThread override:
+ virtual void Execute(void) override;
+} ;
+
+
+
+