SoDaRadio-5.0.3-master:8901fb5
Public Member Functions | Public Attributes | Private Member Functions | List of all members
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... More...
 
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 55 of file IPSockets.hxx.

Constructor & Destructor Documentation

◆ NetSocket()

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

Definition at line 57 of file IPSockets.hxx.

Member Function Documentation

◆ get()

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

Definition at line 177 of file IPSockets.cxx.

References conn_socket.

Referenced by SoDa::IP::ServerSocket::get(), and main().

◆ 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.

Definition at line 245 of file IPSockets.cxx.

References conn_socket, non_blocking_mode, setBlocking(), and setNonBlocking().

Referenced by SoDa::N200Control::setTXOff(), and SoDa::N200Control::setTXOn().

◆ loopWrite()

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

Definition at line 140 of file IPSockets.cxx.

Referenced by put(), and putRaw().

◆ put()

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

Definition at line 164 of file IPSockets.cxx.

References conn_socket, and loopWrite().

Referenced by main(), and SoDa::IP::ServerSocket::put().

◆ putRaw()

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

Definition at line 239 of file IPSockets.cxx.

References conn_socket, and loopWrite().

Referenced by SoDa::N200Control::setTXOff(), and SoDa::N200Control::setTXOn().

◆ setBlocking()

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

Definition at line 87 of file IPSockets.hxx.

Referenced by getRaw(), and SoDa::N200Control::N200Control().

◆ setNonBlocking()

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

Member Data Documentation

◆ client_address

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

Definition at line 94 of file IPSockets.hxx.

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

◆ conn_socket

int SoDa::IP::NetSocket::conn_socket

◆ non_blocking_mode

bool SoDa::IP::NetSocket::non_blocking_mode

Definition at line 95 of file IPSockets.hxx.

Referenced by getRaw().

◆ portnum

int SoDa::IP::NetSocket::portnum

Definition at line 93 of file IPSockets.hxx.

◆ server_socket

int SoDa::IP::NetSocket::server_socket

◆ timeout

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

Definition at line 97 of file IPSockets.hxx.


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