Public Member Functions | Private Member Functions | Private Attributes | List of all members
cISTcpServer Class Reference

#include <ISTcpServer.h>

Inheritance diagram for cISTcpServer:
Inheritance graph
[legend]

Public Member Functions

 cISTcpServer (iISTcpServerDelegate *delegate=NULL)
 
int Close ()
 
bool IsOpen ()
 
int Open (const string &ipAddress, int port)
 
void Update ()
 
int Write (const uint8_t *data, int dataLength)
 
virtual ~cISTcpServer ()
 
- Public Member Functions inherited from cISStream
 cISStream ()
 
virtual int Flush ()
 
virtual long long GetBytesAvailableToRead ()
 
virtual int Read (void *buffer, int count)
 
virtual int Write (const void *buffer, int count)
 
virtual ~cISStream ()
 

Private Member Functions

 cISTcpServer (const cISTcpServer &copy)
 

Private Attributes

vector< socket_t > m_clients
 
iISTcpServerDelegatem_delegate
 
string m_ipAddress
 
int32_t m_port
 
socket_t m_socket
 

Detailed Description

Definition at line 87 of file ISTcpServer.h.

Constructor & Destructor Documentation

◆ cISTcpServer() [1/2]

cISTcpServer::cISTcpServer ( iISTcpServerDelegate delegate = NULL)

Constructor

Definition at line 31 of file ISTcpServer.cpp.

◆ ~cISTcpServer()

cISTcpServer::~cISTcpServer ( )
virtual

Destructor

Definition at line 39 of file ISTcpServer.cpp.

◆ cISTcpServer() [2/2]

cISTcpServer::cISTcpServer ( const cISTcpServer copy)
private

Member Function Documentation

◆ Close()

int cISTcpServer::Close ( )
virtual

Close the server

Returns
0 if success, otherwise an error code

Reimplemented from cISStream.

Definition at line 103 of file ISTcpServer.cpp.

◆ IsOpen()

bool cISTcpServer::IsOpen ( )
inline

Get whether the server is open

Returns
true if server open, false if not

Definition at line 131 of file ISTcpServer.h.

◆ Open()

int cISTcpServer::Open ( const string &  ipAddress,
int  port 
)

Closes, then opens a tcp server

Parameters
ipAddressthe ip address to bind to, empty for auto
portthe port to bind to
Returns
0 if success, otherwise an error code

Definition at line 45 of file ISTcpServer.cpp.

◆ Update()

void cISTcpServer::Update ( )

Update the server, receive connections, etc. Any clients that are disconnected will be closed and removed.

Definition at line 114 of file ISTcpServer.cpp.

◆ Write()

int cISTcpServer::Write ( const uint8_t *  data,
int  dataLength 
)

Write data to all connected clients - any clients that are disconnected will be closed and removed

Parameters
datathe data to write
dataLengththe number of bytes in data
Returns
the number of bytes written

Definition at line 164 of file ISTcpServer.cpp.

Member Data Documentation

◆ m_clients

vector<socket_t> cISTcpServer::m_clients
private

Definition at line 137 of file ISTcpServer.h.

◆ m_delegate

iISTcpServerDelegate* cISTcpServer::m_delegate
private

Definition at line 140 of file ISTcpServer.h.

◆ m_ipAddress

string cISTcpServer::m_ipAddress
private

Definition at line 138 of file ISTcpServer.h.

◆ m_port

int32_t cISTcpServer::m_port
private

Definition at line 139 of file ISTcpServer.h.

◆ m_socket

socket_t cISTcpServer::m_socket
private

Definition at line 136 of file ISTcpServer.h.


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


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:09