TcpLib
Loading...
Searching...
No Matches
tcp::ServerAcceptReceiver Class Reference

Accept-Receiver accepts new clients and registers them with its parent object (usually a Server or a subclass of it). More...

#include <TcpServerAcceptReceiver.h>

Inheritance diagram for tcp::ServerAcceptReceiver:
Collaboration diagram for tcp::ServerAcceptReceiver:

Public Member Functions

 ServerAcceptReceiver (Server *pParent, SOCKET Socket)
 
virtual ~ServerAcceptReceiver ()
 
virtual void cancel () override
 
- Public Member Functions inherited from tcp::Receiver
 Receiver (TcpMain *pParent, SOCKET Socket)
 
virtual ~Receiver ()
 
- Public Member Functions inherited from tcp::ReceiverTransmitter
 ReceiverTransmitter (SOCKET Socket)
 
virtual ~ReceiverTransmitter ()
 
virtual void takeABreak () override
 
virtual void finishBreak () override
 
int getPeerName (std::string &rstrIPAdress, unsigned int &ruiPort) const
 
SOCKET Socket () const
 
- Public Member Functions inherited from eut::RepeatingThread
 RepeatingThread ()
 
virtual ~RepeatingThread ()
 
virtual int start ()
 
bool testCancel ()
 
RepeatingThread::STATUS status () const
 
bool isInExclusiveAccess () const
 
void setExclusiveAccess ()
 
void unsetExclusiveAccess ()
 
int getBreakCounter ()
 
void waitForInput ()
 
void signalInput ()
 

Protected Member Functions

 ServerAcceptReceiver ()
 
 ServerAcceptReceiver (SOCKET)
 
 ServerAcceptReceiver (TcpMain *, SOCKET)
 
virtual void work () override
 
- Protected Member Functions inherited from tcp::Receiver
 Receiver ()
 
 Receiver (SOCKET Socket)
 
- Protected Member Functions inherited from tcp::ReceiverTransmitter
 ReceiverTransmitter ()
 
- Protected Member Functions inherited from eut::RepeatingThread
void threadWork ()
 
void setStatus (STATUS eStatus)
 
STATUS getStatus ()
 
void toOrder (ORDER eOrder)
 
ORDER getOrder ()
 

Private Member Functions

 ServerAcceptReceiver (const ServerAcceptReceiver &)
 
ServerAcceptReceiveroperator= (const ServerAcceptReceiver &)
 

Additional Inherited Members

- Public Types inherited from eut::RepeatingThread
enum  EuTHREADERROR { EuTHREAD_ERR_NO_THREAD = -10301 , EuTHREAD_ERR_THREAD_ALREADY_WORKING = -10302 , EuTHREAD_ERR_THREAD_BREAK_COUNT_LESS_THAN_ZERO = -10303 , EuTHREAD_ERR_UNKNOWN = -10400 }
 Error range = -10301 to -10400 More...
 
enum  STATUS {
  eAT_THE_START , eWORKING , ePAUSING , eENDING ,
  eCOMPLETED
}
 
enum  ORDER { eUNDEFINED , eDO_WORK , eEXIT }
 
- Protected Attributes inherited from tcp::Receiver
TcpMainm_pParentTcpMain
 
- Protected Attributes inherited from tcp::ReceiverTransmitter
SOCKET m_Socket
 

Detailed Description

Accept-Receiver accepts new clients and registers them with its parent object (usually a Server or a subclass of it).

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ ServerAcceptReceiver() [1/5]

tcp::ServerAcceptReceiver::ServerAcceptReceiver ( )
protected

This constructor is not available.

◆ ServerAcceptReceiver() [2/5]

tcp::ServerAcceptReceiver::ServerAcceptReceiver ( SOCKET )
protected

This constructor is not available.

◆ ServerAcceptReceiver() [3/5]

tcp::ServerAcceptReceiver::ServerAcceptReceiver ( TcpMain * ,
SOCKET  )
protected

This constructor is not available.

◆ ServerAcceptReceiver() [4/5]

tcp::ServerAcceptReceiver::ServerAcceptReceiver ( Server * pParent,
SOCKET Socket )

Constructor with parameter passing.

Parameters
[in]pParentThe owning parent object.
[in]SocketThe socket used for communication.
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

◆ ~ServerAcceptReceiver()

virtual tcp::ServerAcceptReceiver::~ServerAcceptReceiver ( )
virtual

Destructor.

◆ ServerAcceptReceiver() [5/5]

tcp::ServerAcceptReceiver::ServerAcceptReceiver ( const ServerAcceptReceiver & )
private

The copy constructor is not available.

Member Function Documentation

◆ cancel()

virtual void tcp::ServerAcceptReceiver::cancel ( )
overridevirtual

The socket is closed and the thread is terminated.

Reimplemented from eut::RepeatingThread.

◆ operator=()

ServerAcceptReceiver & tcp::ServerAcceptReceiver::operator= ( const ServerAcceptReceiver & )
private

The assignment operator is not available.

◆ work()

virtual void tcp::ServerAcceptReceiver::work ( )
overrideprotectedvirtual

Accepts new clients and registers them with its parent object.

Implements eut::RepeatingThread.


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