GlobalObjects
Loading...
Searching...
No Matches
tcp::ServerMessage Class Reference

Is a special Tcp message for the Server. The socket is included so that the server knows to whom it should send the data. More...

#include <TcpMessage.h>

Inheritance diagram for tcp::ServerMessage:

Public Member Functions

 ServerMessage (SOCKET ClientSocket, char *pszRawMsg, std::size_t nRawMsgSize, unsigned int uiMessageID, int iActionCode, const std::string &rstrInfo)
 
 ServerMessage (SOCKET ClientSocket, char *pszTransmitData, std::size_t nTransmitDataSize)
 
virtual ~ServerMessage ()
 
- Public Member Functions inherited from tcp::Message
 Message (char *pszRawMsg, std::size_t nRawMsgSize, unsigned int uiMessageID, int iActionCode, const std::string &rstrInfo)
 
 Message (char *pszTransmitData, std::size_t nTransmitDataSize)
 
virtual ~Message ()
 
int getActionCode () const
 
std::string getInfo () const
 
unsigned int getMsgID () const
 
std::size_t getRawMsg (char *&prszRawMsg, bool bCopy=true)
 
char * getRawMsgPt ()
 
std::size_t getRawMsgSize () const
 
std::size_t getTransmitData (char *&prszSendMsg, bool bCopy=true)
 
char * getTransmitDataPt ()
 
std::size_t getTransmitDataSize () const
 
- Public Member Functions inherited from tcp::AbstractMessage
virtual ~AbstractMessage ()
 
- Public Member Functions inherited from tcp::ServerAcceptMessage
 ServerAcceptMessage (SOCKET NewSocket)
 
virtual ~ServerAcceptMessage ()
 
void closeSocket ()
 
SOCKET getSocket ()
 

Protected Member Functions

 ServerMessage ()
 
 ServerMessage (char *, std::size_t)
 
- Protected Member Functions inherited from tcp::Message
 Message ()
 
- Protected Member Functions inherited from tcp::AbstractMessage
 AbstractMessage ()
 
- Protected Member Functions inherited from tcp::ServerAcceptMessage
 ServerAcceptMessage ()
 

Private Member Functions

 ServerMessage (const ServerMessage &)
 
ServerMessageoperator= (const ServerMessage &)
 

Detailed Description

Is a special Tcp message for the Server. The socket is included so that the server knows to whom it should send the data.

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ ServerMessage() [1/5]

tcp::ServerMessage::ServerMessage ( )
protected

This constructor is not available.

◆ ServerMessage() [2/5]

tcp::ServerMessage::ServerMessage ( char * ,
std::size_t  )
protected

This constructor is not available.

◆ ServerMessage() [3/5]

tcp::ServerMessage::ServerMessage ( SOCKET ClientSocket,
char * pszTransmitData,
std::size_t nTransmitDataSize )

Art constructor with parameters.

Parameters
[in]ClientSocketThe client socket.
[in]pszTransmitDataThe data buffer to be transmitted including all required Information:
  • the abbreviation "hja-tcp" (0-terminated) a simple non-secure way to filter foreign messages.
  • the size of the entire message, i.e. header plus message data (0-terminated)
  • A message ID (0-terminated)
  • a ActionCode (0-terminated)
  • an info (0-terminated)
  • the message data of the message
[in]nTransmitDataSizeThe size or length of the data buffer to be sent.
Attention
This object takes over the removal of the pszTransmitData from the memory.
Exceptions
eut::ErrorNExceptionAn exception is thrown if the attributes cannot be set from the data (e.g. because the header is incorrect).

◆ ServerMessage() [4/5]

tcp::ServerMessage::ServerMessage ( SOCKET ClientSocket,
char * pszRawMsg,
std::size_t nRawMsgSize,
unsigned int uiMessageID,
int iActionCode,
const std::string & rstrInfo )

Art constructor with parameters.

Parameters
[in]ClientSocketThe client socket.
[in]pszRawMsgThe message data.
[in]nRawMsgSizeThe size or length of the message data.
[in]uiMessageIDA unique ID.
[in]iActionCodeThe ActionCode, see m_iActionCode.
[in]rstrInfoAn additional text info
Attention
This object removes the pszRawMsg from the memory
Exceptions
eut::ErrorNExceptionIf m_pszTransmitData cannot be set from the data (e.g. because attributes are invalid), an exception is thrown.

◆ ~ServerMessage()

virtual tcp::ServerMessage::~ServerMessage ( )
virtual

Destructor.

◆ ServerMessage() [5/5]

tcp::ServerMessage::ServerMessage ( const ServerMessage & )
private

The copy constructor is not available.

Member Function Documentation

◆ operator=()

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

The assignment operator is not available.


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