Class Socket

Inheritance Relationships

Derived Type

Class Documentation

class Socket

Abstract base class for a UDP, TCP or IBV Socket.

Subclassed by ska::pst::recv::UDPSocket

Public Functions

Socket()

Construct a new Socket object.

~Socket()

Destroy the Socket object.

virtual void open(int port) = 0

Opens the socket on the specified port and set the file descriptor.

Parameters

port

void close_me()

Close the socket file descriptor.

virtual void resize(size_t new_bufsz)

Resize the socket buffer to the specified size.

Parameters

new_bufsz – new socket size in bytes

void reset_buffer()

Set the socket buffer to zero.

int set_nonblock()

Configure the socket as non blocking.

Returns

int

int set_block()

Configure the socket as blocking.

Returns

int

inline char get_blocking()

Get the blocking object.

Returns

char

inline int get_fd()

Return the socket file descriptor.

Returns

int internal file descriptor

inline char *get_buf()

Return a pointer to the socket buffer.

Returns

char*

inline size_t get_bufsz()

Return the size of the socket buffer.

Returns

size_t socket buffer size in bytes.

Protected Attributes

int fd = {0}

Socket file descriptor.

std::vector<char> buf

Socket buffer.

int port = {0}

Socket port number.