23 #ifndef SOCKETHANDLE_H
24 #define SOCKETHANDLE_H
83 unsigned Recv(
void *ptr,
unsigned len,
bool block);
94 #if !defined(__APPLE__)
108 unsigned Send(
const void *ptr,
unsigned len,
const SendOpts &opts);
int GetReceiveBufferSize()
void SetSendTimeout(double timeout)
SendOpts & Block(bool block)
void ShutdownRead()
Shutdown the read end of this socket. This does NOT close the socket! Any future attempt to read from...
void ShutdownWrite()
Shutdown the write end of this socket. Any future attempt to write to this socket will fail...
void SetSendBufferSize(int size)
An abstraction of a socket address with convenience methods.
A FileHandle customized with some socket specific functionality and functions.
void SetKeepAlive(int ka)
void SetLingerTimeout(int seconds)
Set the linger socket options.
unsigned Recv(void *ptr, unsigned len, bool block)
static void CreatePair(SocketHandle &sock1, SocketHandle &sock2)
Create a socket pair.
SendOpts & More(bool more)
double GetReceiveTimeout()
void SetNoDelay(bool nodelay)
SendOpts & NoSignal(bool sig)
void SetReceiveBufferSize(int size)
int GetPendingError()
Get and clear any pending error.
A class to make it easy to deal with file descriptors.
unsigned Send(const void *ptr, unsigned len, const SendOpts &opts)
std::vector< SocketAddress > SockAddrList
void SetReceiveTimeout(double timeout)
Generic file handle could be a file, or a socket or a device.
void Connect(const SocketAddress &addr)
Create a new socket and try to connect to the given address.