#include <server_socket.h>
|
| virtual void | close (void) |
| |
| virtual bool | connect () |
| |
| virtual socket_t & | connectedSocket (void) |
| |
| virtual bool | is_open (void) |
| |
| virtual bool | open (int tcp_port, bool bTcpAnyHost=false) |
| |
| virtual int | read (int num_bytes, std::vector< uint8_t > &out_buffer, bool read_blocking=true) |
| |
| virtual bool | read (int num_bytes, uint8_t *out_buffer, bool read_blocking=true) |
| |
| | ServerSocket () |
| |
| virtual bool | write (const uint8_t *buffer, int num_bytes, int num_retries_on_error=1) |
| |
| virtual | ~ServerSocket () |
| |
Class sick_scan_xd::ServerSocket implements a server socket connection.
Definition at line 83 of file server_socket.h.
◆ ServerSocket()
| sick_scan_xd::ServerSocket::ServerSocket |
( |
| ) |
|
◆ ~ServerSocket()
| sick_scan_xd::ServerSocket::~ServerSocket |
( |
| ) |
|
|
virtual |
◆ close()
| void sick_scan_xd::ServerSocket::close |
( |
void |
| ) |
|
|
virtual |
◆ connect()
| bool sick_scan_xd::ServerSocket::connect |
( |
| ) |
|
|
virtual |
Waits for a client to connect, creates a socket to read and write.
- Returns
- true on success, false on failure
Definition at line 159 of file server_socket.cpp.
◆ connectedSocket()
| virtual socket_t& sick_scan_xd::ServerSocket::connectedSocket |
( |
void |
| ) |
|
|
inlinevirtual |
◆ is_open()
| bool sick_scan_xd::ServerSocket::is_open |
( |
void |
| ) |
|
|
virtual |
- Returns
- returns true, if the server socket is connected to a client, otherwise false
Definition at line 344 of file server_socket.cpp.
◆ open()
| bool sick_scan_xd::ServerSocket::open |
( |
int |
tcp_port, |
|
|
bool |
bTcpAnyHost = false |
|
) |
| |
|
virtual |
Opens a listening server socket.
- Returns
- true on success, false on failure
Definition at line 107 of file server_socket.cpp.
◆ read() [1/2]
| int sick_scan_xd::ServerSocket::read |
( |
int |
num_bytes, |
|
|
std::vector< uint8_t > & |
out_buffer, |
|
|
bool |
read_blocking = true |
|
) |
| |
|
virtual |
Reads bytes from the socket.
- Returns
- number of bytes read, or -1 on error (invalid socket, broken connection)
Definition at line 197 of file server_socket.cpp.
◆ read() [2/2]
| bool sick_scan_xd::ServerSocket::read |
( |
int |
num_bytes, |
|
|
uint8_t * |
out_buffer, |
|
|
bool |
read_blocking = true |
|
) |
| |
|
virtual |
Read <num_bytes> bytes from the socket.
- Returns
- true on success, false on failure
Definition at line 264 of file server_socket.cpp.
◆ write()
| bool sick_scan_xd::ServerSocket::write |
( |
const uint8_t * |
buffer, |
|
|
int |
num_bytes, |
|
|
int |
num_retries_on_error = 1 |
|
) |
| |
|
virtual |
Writes bytes to the socket.
- Returns
- true on success, false on failure
Definition at line 277 of file server_socket.cpp.
◆ m_iListenPortNumber
| int sick_scan_xd::ServerSocket::m_iListenPortNumber |
|
protected |
◆ m_tConnectedSocket
| socket_t sick_scan_xd::ServerSocket::m_tConnectedSocket |
|
protected |
◆ m_tListenSocket
| socket_t sick_scan_xd::ServerSocket::m_tListenSocket |
|
protected |
The documentation for this class was generated from the following files: