class OSocket : public ISocketTypes, public OReferenceCounter Represents a socket
| | bind (const OSocketAddr& LocalInterface) Binds the socket to the specified (local) interface |
| | clearError () Gets and clears the error status of the socket |
| | close () Closes the socket |
| | enableNonBlockingMode (Boolean On= True) Enables/disables non-blocking mode of the socket |
| | getError (char* pBuffer, int nSize) Builds a string with the last error-message for the socket |
| | getError () Delivers a constant decribing the last error for the socket system |
| | getLocalAddr (OSocketAddr& Addr) Retrieves the address of the local interface of this socket |
| | getLocalHost () Get the hostname for the local interface |
| | getLocalPort () Get the local port of the socket |
| | getOption (TSocketOption Option, void* pBuffer, int BufferLen, TSocketOptionLevel Level= sol_socket) Retrieves option-attributes associated with the socket |
| | getPeerAddr (OSocketAddr& Addr) Retrieves the address of the remote host of this socket |
| | getPeerHost () Get the hostname for the remote interface |
| | getPeerPort () Get the remote port of the socket |
| | getType () Queries the socket for its type |
| | isExceptionPending (int wp_sec, int wp_usec = 0) Checks if a request for out-of-band data will block |
| | isRecvReady (int wp_sec, int wp_usec = 0) Checks if read operations will block |
| | isSendReady (int wp_sec, int wp_usec = 0) Checks if send operations will block |
| | isValid () Checks if the socket is valid |
| | operator oslSocket () Allow cast to underlying oslSocket |
| | operator oslSocket () Allow cast to underlying oslSocket |
| | OSocket (const OSocket& sock) Copy constructor |
| | OSocket (oslSocket Socket) Creates socket as wrapper around the underlying oslSocket |
| | OSocket (TSocketType Type = sock_stream, TAddrFamily Family = af_inet, TProtocol Protocol = protocol_ip) Creates a socket |
| | setBroadcast (int opt = -1) Allow transmission of broadcast messages on the socket |
| | setDebug (int opt = -1) Enables/Disables debugging |
| | setDontRoute (int opt = -1) Do not route: send directly to interface |
| | setKeepAlive (int opt = -1) Send keepalive-packets |
| | setLinger (int time = -1) Linger on close if unsent data is present |
| | setOobinline (int opt = -1) Receive out-of-band data in the normal data stream |
| | setOption (TSocketOption Option, void* pBuffer, int BufferLen, TSocketOptionLevel Level= sol_socket) Sets the sockets attributes |
| | setRecvBufSize (int size =-1) Specify buffer size for receives |
| | setRecvTimeout (int time= -1) Blocking receive operations will unblock after the send-timeout |
| | setReuseAddr (int opt = -1) Allow the socket to be bound to an address that is already in use |
| | setSendBufSize (int size =-1) Specify buffer size for sends |
| | setSendTimeout (int time= -1) Blocking send operations will unblock after the send-timeout |
| | setTcpNoDelay (int sz =-1) Disables the Nagle algorithm for send coalescing |
| | ~OSocket () Destructor |
Represents a socket
OSocket(const OSocket& sock)
OSocket(oslSocket Socket)
virtual ~OSocket()
operator oslSocket()
operator oslSocket()
Boolean isValid()
void close()
void getLocalAddr(OSocketAddr& Addr)
int getLocalPort()
const char* getLocalHost()
void getPeerAddr(OSocketAddr& Addr)
int getPeerPort()
const char* getPeerHost()
Boolean bind(const OSocketAddr& LocalInterface)
int setSendTimeout(int time= -1)
int setRecvTimeout(int time= -1)
Boolean isRecvReady(int wp_sec, int wp_usec = 0)
wp_usec - adds microsecond resolution to the timeout given by wp_sec.
Boolean isSendReady(int wp_sec, int wp_usec = 0)
wp_usec - adds microsecond resolution to the timeout given by wp_sec.
Boolean isExceptionPending(int wp_sec, int wp_usec = 0)
wp_usec - adds microsecond resolution to the timeout given by wp_sec.
int getOption(TSocketOption Option, void* pBuffer, int BufferLen, TSocketOptionLevel Level= sol_socket)
If not above mentioned otherwise, the options are only valid for
level sol_socket.
pBuffer - The Buffer will be filled with the attribute.
BufferSize - The size of pBuffer.
Level - The option level. Valid values are:
Boolean setOption(TSocketOption Option, void* pBuffer, int BufferLen, TSocketOptionLevel Level= sol_socket)
If not above mentioned otherwise, the options are only valid for
level sol_socket.
pBuffer - Pointer to a Buffer which contains the attribute-value.
BufferSize - contains the length of the Buffer.
Level - selects the level for which an option should be changed.
Valid values are:
Boolean enableNonBlockingMode(Boolean On= True)
TSocketType getType()
int clearError()
int setDebug(int opt = -1)
int setReuseAddr(int opt = -1)
int setKeepAlive(int opt = -1)
int setDontRoute(int opt = -1)
int setBroadcast(int opt = -1)
int setOobinline(int opt = -1)
int setLinger(int time = -1)
int setSendBufSize(int size =-1)
int setRecvBufSize(int size =-1)
int setTcpNoDelay(int sz =-1)
void getError(char* pBuffer, int nSize)
nSize - the size of pBuffer. The message will be cut
short if the buffer isn't large enough, but still remains
a valid zero-terminated string.
TSocketError getError()
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de