SpiecsEngine
 
Loading...
Searching...
No Matches
Spices::Net::Acceptor Class Reference

Wrapper of Channel and Socket, As the entrance of comm. More...

#include <Acceptor.h>

Public Types

using ConnectionCallback = std::function<void(SOCKET, const InetAddress&)>
 

Public Member Functions

 Acceptor (const InetAddress &listenAddress, bool reusePort)
 Constructor Function.
 
virtual ~Acceptor ()
 Destructor Function.
 
 Acceptor (const Acceptor &)=delete
 Copy Constructor Function.
 
Acceptoroperator= (const Acceptor &)=delete
 Copy Assignment Operation.
 
void SetConnectionCallback (const ConnectionCallback &cb)
 Set ConnectionCallback.
 
bool IsListening () const
 Determine if this is in listening. @reutrn Returns true if is in listening.
 
void Listen ()
 Listen accept socket.
 

Private Member Functions

void HandleRead () const
 On Read Event Callback.
 

Private Attributes

Socket m_AcceptSocket
 Acceptor Socket.
 
std::shared_ptr< Channelm_AcceptChannel
 Acceptor Channel.
 
ConnectionCallback m_ConnectionCallback
 ConnectionCallback.
 
bool m_IsListening
 Boolean of whether is in listening.
 

Detailed Description

Wrapper of Channel and Socket, As the entrance of comm.

Definition at line 23 of file Acceptor.h.


The documentation for this class was generated from the following files: