SysServerConnection Class Reference

#include <SysCSStream.hpp>

Inheritance diagram for SysServerConnection:
[legend]

Public Member Functions

 SysServerConnection (SysServerStream *s, int socket)
 
 ~SysServerConnection ()
 
bool isLocalConnection ()
 
bool disconnect (void)
 
 SysServerConnection (SysServerStream *s, SOCKET socket)
 
 ~SysServerConnection ()
 
bool isLocalConnection ()
 
bool disconnect (void)
 
- Public Member Functions inherited from SysSocketConnection
 SysSocketConnection ()
 
 SysSocketConnection (int sock)
 
 ~SysSocketConnection ()
 
CSErrorCodeT getError (void)
 
bool read (void *buf, size_t bufsize, size_t *bytesread)
 
bool write (void *buf, size_t bufsize, size_t *byteswritten)
 
bool write (void *buf, size_t bufsize, void *buf2, size_t buf2size, size_t *byteswritten)
 
 SysSocketConnection ()
 
 SysSocketConnection (SOCKET sock)
 
 ~SysSocketConnection ()
 
CSErrorCodeT getError (void)
 
bool read (void *buf, size_t bufsize, size_t *bytesread)
 
bool write (void *buf, size_t bufsize, size_t *byteswritten)
 
bool write (void *buf, size_t bufsize, void *buf2, size_t buf2size, size_t *byteswritten)
 

Protected Member Functions

char * getMessageBuffer ()
 
void returnMessageBuffer (void *)
 
- Protected Member Functions inherited from SysSocketConnection
char * getMessageBuffer (size_t size)
 
void returnMessageBuffer (void *)
 
char * getMessageBuffer (size_t size)
 
void returnMessageBuffer (void *)
 

Protected Attributes

SysServerStreamserver
 
- Protected Attributes inherited from SysSocketConnection
int c
 
CSErrorCodeT errcode
 
char * messageBuffer
 
SOCKET c
 

Additional Inherited Members

- Protected Types inherited from SysSocketConnection
enum  { MAX_CACHED_BUFFER = 4096 }
 
enum  { MAX_CACHED_BUFFER = 4096 }
 

Detailed Description

Class to manage a single instance of a server connection. These are created any time a server stream object accepts a connection.

Definition at line 135 of file unix/SysCSStream.hpp.

Constructor & Destructor Documentation

◆ SysServerConnection() [1/2]

SysServerConnection::SysServerConnection ( SysServerStream s,
int  socket 
)

Server connection constructor.

Parameters
sThe parent server connection.
socketThe socket for the connection.

Definition at line 592 of file unix/SysCSStream.cpp.

References server.

◆ ~SysServerConnection() [1/2]

SysServerConnection::~SysServerConnection ( )

Standard destructor.

Definition at line 600 of file unix/SysCSStream.cpp.

References disconnect().

◆ SysServerConnection() [2/2]

SysServerConnection::SysServerConnection ( SysServerStream s,
SOCKET  socket 
)

Server connection constructor.

Parameters
sThe parent server connection.
socketThe socket for the connection.

Definition at line 591 of file windows/SysCSStream.cpp.

References server.

◆ ~SysServerConnection() [2/2]

SysServerConnection::~SysServerConnection ( )

Member Function Documentation

◆ disconnect() [1/2]

bool SysServerConnection::disconnect ( void  )

Close the connection to the host.

Returns
True on an error, otherwise false.

Close the server connection.

Returns
True on an error, otherwise false

Definition at line 641 of file unix/SysCSStream.cpp.

References SysSocketConnection::c, CSERROR_INTERNAL, CSERROR_OK, and SysSocketConnection::errcode.

Referenced by APIServer::processMessages(), and ~SysServerConnection().

◆ disconnect() [2/2]

bool SysServerConnection::disconnect ( void  )

◆ getMessageBuffer()

char* SysServerConnection::getMessageBuffer ( )
protected

◆ isLocalConnection() [1/2]

bool SysServerConnection::isLocalConnection ( void  )

Is the connection with the localhost?

Returns
True if the client is at address 127.0.0.1, otherwise false

Definition at line 612 of file unix/SysCSStream.cpp.

References SysSocketConnection::c.

◆ isLocalConnection() [2/2]

bool SysServerConnection::isLocalConnection ( )

◆ returnMessageBuffer()

void SysServerConnection::returnMessageBuffer ( void *  )
protected

Member Data Documentation

◆ server

SysServerStream * SysServerConnection::server
protected

Definition at line 145 of file unix/SysCSStream.hpp.

Referenced by SysServerConnection().


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