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

Superclass for all Receiver and Transmitter, which communicate via a SOCKET. More...

#include <TcpReceiverTransmitter.h>

Inheritance diagram for tcp::ReceiverTransmitter:
Collaboration diagram for tcp::ReceiverTransmitter:

Public Member Functions

 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 ()
 
virtual void cancel ()
 
bool testCancel ()
 
RepeatingThread::STATUS status () const
 
bool isInExclusiveAccess () const
 
void setExclusiveAccess ()
 
void unsetExclusiveAccess ()
 
int getBreakCounter ()
 
void waitForInput ()
 
void signalInput ()
 

Protected Member Functions

 ReceiverTransmitter ()
 
- Protected Member Functions inherited from eut::RepeatingThread
void threadWork ()
 
void setStatus (STATUS eStatus)
 
STATUS getStatus ()
 
void toOrder (ORDER eOrder)
 
ORDER getOrder ()
 
virtual void work ()=0
 

Protected Attributes

SOCKET m_Socket
 

Private Member Functions

 ReceiverTransmitter (const ReceiverTransmitter &)
 
ReceiverTransmitteroperator= (const ReceiverTransmitter &)
 

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 }
 

Detailed Description

Superclass for all Receiver and Transmitter, which communicate via a SOCKET.

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ ReceiverTransmitter() [1/3]

tcp::ReceiverTransmitter::ReceiverTransmitter ( )
protected

This constructor is not available.

◆ ReceiverTransmitter() [2/3]

tcp::ReceiverTransmitter::ReceiverTransmitter ( SOCKET Socket)

Constructor with parameter passing.

Parameters
[in]SocketThe socket via which communication takes place.
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

◆ ~ReceiverTransmitter()

virtual tcp::ReceiverTransmitter::~ReceiverTransmitter ( )
virtual

Destructor. The socked is closed.

◆ ReceiverTransmitter() [3/3]

tcp::ReceiverTransmitter::ReceiverTransmitter ( const ReceiverTransmitter & )
private

The copy constructor is not available.

Member Function Documentation

◆ finishBreak()

virtual void tcp::ReceiverTransmitter::finishBreak ( )
overridevirtual

These threads must not pause because they themselves are blocking!

Exceptions
eut::ErrorNExceptionAn exception is thrown when called.

Reimplemented from eut::RepeatingThread.

◆ getPeerName()

int tcp::ReceiverTransmitter::getPeerName ( std::string & rstrIPAdress,
unsigned int & ruiPort ) const

Returns the IP address and the port.

Parameters
[in,out]rstrIPAdressThe IP address (e.g. "LOCALHOST" or "192.168.2.102").
[in,out]ruiPortThe port which is addressed.
Returns
A return value < 0 indicates an error.

◆ operator=()

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

The assignment operator is not available.

◆ Socket()

SOCKET tcp::ReceiverTransmitter::Socket ( ) const

Returns the socket.

◆ takeABreak()

virtual void tcp::ReceiverTransmitter::takeABreak ( )
overridevirtual

These threads must not pause because they themselves are blocking!

Exceptions
eut::ErrorNExceptionAn exception is thrown when called.

Reimplemented from eut::RepeatingThread.

Member Data Documentation

◆ m_Socket

SOCKET tcp::ReceiverTransmitter::m_Socket
protected

All derived classes communicate via a socket.


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