SoDaRadio-12.2.0-cut_dependencies:6c82803
Loading...
Searching...
No Matches
SoDa::IP::NetSocket Class Reference

#include <IPSockets.hxx>

Inheritance diagram for SoDa::IP::NetSocket:
SoDa::IP::ClientSocket SoDa::IP::ServerSocket SoDa::IP::LineServerSocket

Public Member Functions

 NetSocket ()
int put (const void *ptr, unsigned int size)
int get (void *ptr, unsigned int size)
int putRaw (const void *ptr, unsigned int size)
int getRaw (const void *ptr, unsigned int size, unsigned int usec_timeout=0)
 get a raw string of <size> bytes...
void setNonBlocking ()
void setBlocking ()

Public Attributes

int server_socket
int conn_socket
int portnum
struct sockaddr_in server_address client_address
bool non_blocking_mode
struct timeval timeout

Private Member Functions

int loopWrite (int fd, const void *ptr, unsigned int nbytes)

Detailed Description

Definition at line 56 of file IPSockets.hxx.

Constructor & Destructor Documentation

◆ NetSocket()

SoDa::IP::NetSocket::NetSocket ( )
inline

Definition at line 58 of file IPSockets.hxx.

References timeout.

Member Function Documentation

◆ get()

int SoDa::IP::NetSocket::get ( void * ptr,
unsigned int size )

◆ getRaw()

int SoDa::IP::NetSocket::getRaw ( const void * ptr,
unsigned int size,
unsigned int usec_timeout = 0 )

get a raw string of <size> bytes...

Parameters
ptrpointer to a buffer
sizedon't return until we've gotten <size> bytes, or timed out
usec_timeoutreturn FALSE if we wait longer than this, 0 says don't timeout
Returns
0 if we got all <size> bytes, -1 if we timed out.

◆ loopWrite()

int SoDa::IP::NetSocket::loopWrite ( int fd,
const void * ptr,
unsigned int nbytes )
private

◆ put()

int SoDa::IP::NetSocket::put ( const void * ptr,
unsigned int size )

◆ putRaw()

int SoDa::IP::NetSocket::putRaw ( const void * ptr,
unsigned int size )

◆ setBlocking()

void SoDa::IP::NetSocket::setBlocking ( )
inline

Definition at line 89 of file IPSockets.hxx.

References conn_socket, and non_blocking_mode.

◆ setNonBlocking()

void SoDa::IP::NetSocket::setNonBlocking ( )
inline

Definition at line 83 of file IPSockets.hxx.

References conn_socket, and non_blocking_mode.

Referenced by SoDa::IP::LineServerSocket::LineServerSocket().

Member Data Documentation

◆ client_address

struct sockaddr_in server_address SoDa::IP::NetSocket::client_address

Definition at line 96 of file IPSockets.hxx.

◆ conn_socket

◆ non_blocking_mode

bool SoDa::IP::NetSocket::non_blocking_mode

Definition at line 97 of file IPSockets.hxx.

Referenced by setBlocking(), and setNonBlocking().

◆ portnum

◆ server_socket

int SoDa::IP::NetSocket::server_socket

Definition at line 95 of file IPSockets.hxx.

Referenced by SoDa::IP::ServerSocket::~ServerSocket().

◆ timeout

struct timeval SoDa::IP::NetSocket::timeout

Definition at line 99 of file IPSockets.hxx.

Referenced by NetSocket().


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