Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
Poco::Net::SocketImpl Class Reference

#include <SocketImpl.h>

+ Inheritance diagram for Poco::Net::SocketImpl:
+ Collaboration diagram for Poco::Net::SocketImpl:

Public Types

enum  SelectMode { SELECT_READ = 1 , SELECT_WRITE = 2 , SELECT_ERROR = 4 }
 

Public Member Functions

virtual SocketImplacceptConnection (SocketAddress &clientAddr)
 
virtual void connect (const SocketAddress &address)
 
virtual void connect (const SocketAddress &address, const Poco::Timespan &timeout)
 
virtual void connectNB (const SocketAddress &address)
 
virtual void bind (const SocketAddress &address, bool reuseAddress=false)
 
virtual void bind (const SocketAddress &address, bool reuseAddress, bool reusePort)
 
virtual void bind6 (const SocketAddress &address, bool reuseAddress=false, bool ipV6Only=false)
 
virtual void bind6 (const SocketAddress &address, bool reuseAddress, bool reusePort, bool ipV6Only)
 
virtual void listen (int backlog=64)
 
virtual void close ()
 
virtual void shutdownReceive ()
 Close the socket.
 
virtual void shutdownSend ()
 Shuts down the receiving part of the socket connection.
 
virtual void shutdown ()
 Shuts down the sending part of the socket connection.
 
virtual int sendBytes (const void *buffer, int length, int flags=0)
 
virtual int sendBytes (const SocketBufVec &buffers, int flags=0)
 
virtual int receiveBytes (void *buffer, int length, int flags=0)
 
virtual int receiveBytes (SocketBufVec &buffers, int flags=0)
 
virtual int receiveBytes (Poco::Buffer< char > &buffer, int flags=0, const Poco::Timespan &timeout=100000)
 
virtual int sendTo (const void *buffer, int length, const SocketAddress &address, int flags=0)
 
virtual int sendTo (const SocketBufVec &buffers, const SocketAddress &address, int flags=0)
 
int receiveFrom (void *buffer, int length, struct sockaddr **ppSA, poco_socklen_t **ppSALen, int flags=0)
 
virtual int receiveFrom (void *buffer, int length, SocketAddress &address, int flags=0)
 
virtual int receiveFrom (SocketBufVec &buffers, SocketAddress &address, int flags=0)
 
int receiveFrom (SocketBufVec &buffers, struct sockaddr **ppSA, poco_socklen_t **ppSALen, int flags)
 
virtual void sendUrgent (unsigned char data)
 
virtual int available ()
 
virtual bool poll (const Poco::Timespan &timeout, int mode)
 
virtual void setSendBufferSize (int size)
 
virtual int getSendBufferSize ()
 Sets the size of the send buffer.
 
virtual void setReceiveBufferSize (int size)
 
virtual int getReceiveBufferSize ()
 Sets the size of the receive buffer.
 
virtual void setSendTimeout (const Poco::Timespan &timeout)
 
virtual Poco::Timespan getSendTimeout ()
 Sets the send timeout for the socket.
 
virtual void setReceiveTimeout (const Poco::Timespan &timeout)
 
virtual Poco::Timespan getReceiveTimeout ()
 
virtual SocketAddress address ()
 
virtual SocketAddress peerAddress ()
 Returns the IP address and port number of the socket.
 
void setOption (int level, int option, int value)
 Returns the IP address and port number of the peer socket.
 
void setOption (int level, int option, unsigned value)
 
void setOption (int level, int option, unsigned char value)
 
void setOption (int level, int option, const Poco::Timespan &value)
 
void setOption (int level, int option, const IPAddress &value)
 
virtual void setRawOption (int level, int option, const void *value, poco_socklen_t length)
 
void getOption (int level, int option, int &value)
 
void getOption (int level, int option, unsigned &value)
 
void getOption (int level, int option, unsigned char &value)
 
void getOption (int level, int option, Poco::Timespan &value)
 
void getOption (int level, int option, IPAddress &value)
 
virtual void getRawOption (int level, int option, void *value, poco_socklen_t &length)
 
void setLinger (bool on, int seconds)
 
void getLinger (bool &on, int &seconds)
 Sets the value of the SO_LINGER socket option.
 
void setNoDelay (bool flag)
 Returns the value of the SO_LINGER socket option.
 
bool getNoDelay ()
 Sets the value of the TCP_NODELAY socket option.
 
void setKeepAlive (bool flag)
 Returns the value of the TCP_NODELAY socket option.
 
bool getKeepAlive ()
 Sets the value of the SO_KEEPALIVE socket option.
 
void setReuseAddress (bool flag)
 Returns the value of the SO_KEEPALIVE socket option.
 
bool getReuseAddress ()
 Sets the value of the SO_REUSEADDR socket option.
 
void setReusePort (bool flag)
 Returns the value of the SO_REUSEADDR socket option.
 
bool getReusePort ()
 
void setOOBInline (bool flag)
 
bool getOOBInline ()
 Sets the value of the SO_OOBINLINE socket option.
 
void setBroadcast (bool flag)
 Returns the value of the SO_OOBINLINE socket option.
 
bool getBroadcast ()
 Sets the value of the SO_BROADCAST socket option.
 
virtual void setBlocking (bool flag)
 Returns the value of the SO_BROADCAST socket option.
 
virtual bool getBlocking () const
 
virtual bool secure () const
 
int socketError ()
 
poco_socket_t sockfd () const
 Returns the value of the SO_ERROR socket option.
 
void ioctl (poco_ioctl_request_t request, int &arg)
 
void ioctl (poco_ioctl_request_t request, void *arg)
 A wrapper for the ioctl system call.
 
bool initialized () const
 A wrapper for the ioctl system call.
 
- Public Member Functions inherited from Poco::RefCountedObject
 RefCountedObject ()
 
void duplicate () const
 
void release () const noexcept
 Increments the object's reference count.
 
int referenceCount () const
 

Protected Member Functions

 SocketImpl ()
 Returns true iff the underlying socket is initialized.
 
 SocketImpl (poco_socket_t sockfd)
 Creates a SocketImpl.
 
virtual ~SocketImpl ()
 Creates a SocketImpl using the given native socket.
 
virtual void init (int af)
 
void initSocket (int af, int type, int proto=0)
 
void reset (poco_socket_t fd=POCO_INVALID_SOCKET)
 
void checkBrokenTimeout (SelectMode mode)
 Allows subclasses to set the socket manually, iff no valid socket is set yet.
 
- Protected Member Functions inherited from Poco::RefCountedObject
virtual ~RefCountedObject ()
 Returns the reference count.
 

Static Protected Member Functions

static int lastError ()
 
static void error ()
 Returns the last error code.
 
static void error (const std::string &arg)
 Throws an appropriate exception for the last error.
 
static void error (int code)
 Throws an appropriate exception for the last error.
 
static void error (int code, const std::string &arg)
 Throws an appropriate exception for the given error code.
 

Private Member Functions

 SocketImpl (const SocketImpl &)
 Throws an appropriate exception for the given error code.
 
SocketImploperator= (const SocketImpl &)
 

Private Attributes

poco_socket_t _sockfd
 
Poco::Timespan _recvTimeout
 
Poco::Timespan _sndTimeout
 
bool _blocking
 
bool _isBrokenTimeout
 

Friends

class Socket
 
class SecureSocketImpl
 
class PollSetImpl
 

Detailed Description

This class encapsulates the Berkeley sockets API.

Subclasses implement specific socket types like
stream or datagram sockets.

You should not create any instances of this class. 

Definition at line 33 of file SocketImpl.h.

Member Enumeration Documentation

◆ SelectMode

Enumerator
SELECT_READ 
SELECT_WRITE 
SELECT_ERROR 

Definition at line 42 of file SocketImpl.h.

Constructor & Destructor Documentation

◆ SocketImpl() [1/3]

Poco::Net::SocketImpl::SocketImpl ( )
protected

Returns true iff the underlying socket is initialized.

◆ SocketImpl() [2/3]

Poco::Net::SocketImpl::SocketImpl ( poco_socket_t sockfd)
protected

Creates a SocketImpl.

◆ ~SocketImpl()

virtual Poco::Net::SocketImpl::~SocketImpl ( )
protectedvirtual

Creates a SocketImpl using the given native socket.

◆ SocketImpl() [3/3]

Poco::Net::SocketImpl::SocketImpl ( const SocketImpl & )
private

Throws an appropriate exception for the given error code.

Member Function Documentation

◆ acceptConnection()

virtual SocketImpl * Poco::Net::SocketImpl::acceptConnection ( SocketAddress & clientAddr)
virtual

◆ address()

virtual SocketAddress Poco::Net::SocketImpl::address ( )
virtual

Returns the receive timeout for the socket.

The returned timeout may be different than the timeout previously set with setReceiveTimeout(), as the system is free to adjust the value.

+ Here is the caller graph for this function:

◆ available()

virtual int Poco::Net::SocketImpl::available ( )
virtual

Sends one byte of urgent data through the socket.

The data is sent with the MSG_OOB flag.

The preferred way for a socket to receive urgent data is by enabling the SO_OOBINLINE option.

+ Here is the caller graph for this function:

◆ bind() [1/2]

virtual void Poco::Net::SocketImpl::bind ( const SocketAddress & address,
bool reuseAddress,
bool reusePort )
virtual

Bind a local address to the socket.

This is usually only done when establishing a server socket. TCP clients should not bind a socket to a specific address.

If reuseAddress is true, sets the SO_REUSEADDR socket option.

◆ bind() [2/2]

virtual void Poco::Net::SocketImpl::bind ( const SocketAddress & address,
bool reuseAddress = false )
virtual

Initializes the socket and establishes a connection to the TCP server at the given address. Prior to opening the connection the socket is set to nonblocking mode.

◆ bind6() [1/2]

virtual void Poco::Net::SocketImpl::bind6 ( const SocketAddress & address,
bool reuseAddress,
bool reusePort,
bool ipV6Only )
virtual

Bind a local IPv6 address to the socket.

This is usually only done when establishing a server socket. TCP clients should not bind a socket to a specific address.

If reuseAddress is true, sets the SO_REUSEADDR socket option.

The given address must be an IPv6 address. The IPPROTO_IPV6/IPV6_V6ONLY option is set on the socket according to the ipV6Only parameter.

If the library has not been built with IPv6 support, a Poco::NotImplementedException will be thrown.

◆ bind6() [2/2]

virtual void Poco::Net::SocketImpl::bind6 ( const SocketAddress & address,
bool reuseAddress = false,
bool ipV6Only = false )
virtual

Bind a local address to the socket.

This is usually only done when establishing a server socket. TCP clients should not bind a socket to a specific address.

If reuseAddress is true, sets the SO_REUSEADDR socket option.

If reusePort is true, sets the SO_REUSEPORT socket option.

◆ checkBrokenTimeout()

void Poco::Net::SocketImpl::checkBrokenTimeout ( SelectMode mode)
protected

Allows subclasses to set the socket manually, iff no valid socket is set yet.

◆ close()

virtual void Poco::Net::SocketImpl::close ( )
virtual

Puts the socket into listening state.

The socket becomes a passive socket that can accept incoming connection requests.

The backlog argument specifies the maximum number of connections that can be queued for this socket.

+ Here is the caller graph for this function:

◆ connect() [1/2]

virtual void Poco::Net::SocketImpl::connect ( const SocketAddress & address)
virtual

Get the next completed connection from the socket's completed connection queue.

If the queue is empty, waits until a connection request completes.

Returns a new TCP socket for the connection with the client.

The client socket's address is returned in clientAddr.

◆ connect() [2/2]

virtual void Poco::Net::SocketImpl::connect ( const SocketAddress & address,
const Poco::Timespan & timeout )
virtual

Initializes the socket and establishes a connection to the TCP server at the given address.

Can also be used for UDP sockets. In this case, no connection is established. Instead, incoming and outgoing packets are restricted to the specified address.

◆ connectNB()

virtual void Poco::Net::SocketImpl::connectNB ( const SocketAddress & address)
virtual

Initializes the socket, sets the socket timeout and establishes a connection to the TCP server at the given address.

◆ error() [1/4]

static void Poco::Net::SocketImpl::error ( )
staticprotected

Returns the last error code.

◆ error() [2/4]

static void Poco::Net::SocketImpl::error ( const std::string & arg)
staticprotected

Throws an appropriate exception for the last error.

◆ error() [3/4]

static void Poco::Net::SocketImpl::error ( int code)
staticprotected

Throws an appropriate exception for the last error.

◆ error() [4/4]

static void Poco::Net::SocketImpl::error ( int code,
const std::string & arg )
staticprotected

Throws an appropriate exception for the given error code.

◆ getBlocking()

bool Poco::Net::SocketImpl::getBlocking ( ) const
inlinevirtual

Sets the socket in blocking mode if flag is true, disables blocking mode if flag is false.

Definition at line 551 of file SocketImpl.h.

+ Here is the caller graph for this function:

◆ getBroadcast()

bool Poco::Net::SocketImpl::getBroadcast ( )

Sets the value of the SO_BROADCAST socket option.

◆ getKeepAlive()

bool Poco::Net::SocketImpl::getKeepAlive ( )

Sets the value of the SO_KEEPALIVE socket option.

+ Here is the caller graph for this function:

◆ getLinger()

void Poco::Net::SocketImpl::getLinger ( bool & on,
int & seconds )

Sets the value of the SO_LINGER socket option.

+ Here is the caller graph for this function:

◆ getNoDelay()

bool Poco::Net::SocketImpl::getNoDelay ( )

Sets the value of the TCP_NODELAY socket option.

+ Here is the caller graph for this function:

◆ getOOBInline()

bool Poco::Net::SocketImpl::getOOBInline ( )

Sets the value of the SO_OOBINLINE socket option.

+ Here is the caller graph for this function:

◆ getOption() [1/5]

void Poco::Net::SocketImpl::getOption ( int level,
int option,
int & value )

Sets the socket option specified by level and option to the given time value.

+ Here is the caller graph for this function:

◆ getOption() [2/5]

void Poco::Net::SocketImpl::getOption ( int level,
int option,
IPAddress & value )

Returns the value of the socket option specified by level and option.

+ Here is the caller graph for this function:

◆ getOption() [3/5]

void Poco::Net::SocketImpl::getOption ( int level,
int option,
Poco::Timespan & value )

Returns the value of the socket option specified by level and option.

+ Here is the caller graph for this function:

◆ getOption() [4/5]

void Poco::Net::SocketImpl::getOption ( int level,
int option,
unsigned & value )

Returns the value of the socket option specified by level and option.

+ Here is the caller graph for this function:

◆ getOption() [5/5]

void Poco::Net::SocketImpl::getOption ( int level,
int option,
unsigned char & value )

Returns the value of the socket option specified by level and option.

+ Here is the caller graph for this function:

◆ getRawOption()

virtual void Poco::Net::SocketImpl::getRawOption ( int level,
int option,
void * value,
poco_socklen_t & length )
virtual

Returns the value of the socket option specified by level and option.

◆ getReceiveBufferSize()

virtual int Poco::Net::SocketImpl::getReceiveBufferSize ( )
virtual

Sets the size of the receive buffer.

+ Here is the caller graph for this function:

◆ getReceiveTimeout()

virtual Poco::Timespan Poco::Net::SocketImpl::getReceiveTimeout ( )
virtual

Sets the receive timeout for the socket.

On systems that do not support SO_RCVTIMEO, a workaround using poll() is provided.

+ Here is the caller graph for this function:

◆ getReuseAddress()

bool Poco::Net::SocketImpl::getReuseAddress ( )

Sets the value of the SO_REUSEADDR socket option.

+ Here is the caller graph for this function:

◆ getReusePort()

bool Poco::Net::SocketImpl::getReusePort ( )

Sets the value of the SO_REUSEPORT socket option. Does nothing if the socket implementation does not support SO_REUSEPORT.

+ Here is the caller graph for this function:

◆ getSendBufferSize()

virtual int Poco::Net::SocketImpl::getSendBufferSize ( )
virtual

Sets the size of the send buffer.

+ Here is the caller graph for this function:

◆ getSendTimeout()

virtual Poco::Timespan Poco::Net::SocketImpl::getSendTimeout ( )
virtual

Sets the send timeout for the socket.

+ Here is the caller graph for this function:

◆ init()

virtual void Poco::Net::SocketImpl::init ( int af)
protectedvirtual

Destroys the SocketImpl. Closes the socket if it is still open.

+ Here is the caller graph for this function:

◆ initialized()

bool Poco::Net::SocketImpl::initialized ( ) const
inline

A wrapper for the ioctl system call.

Definition at line 535 of file SocketImpl.h.

◆ initSocket()

void Poco::Net::SocketImpl::initSocket ( int af,
int type,
int proto = 0 )
protected

Creates the underlying native socket.

Subclasses must implement this method so that it calls initSocket() with the appropriate arguments.

The default implementation creates a stream socket.

◆ ioctl() [1/2]

void Poco::Net::SocketImpl::ioctl ( poco_ioctl_request_t request,
int & arg )

Returns the socket descriptor for the underlying native socket.

◆ ioctl() [2/2]

void Poco::Net::SocketImpl::ioctl ( poco_ioctl_request_t request,
void * arg )

A wrapper for the ioctl system call.

◆ lastError()

int Poco::Net::SocketImpl::lastError ( )
inlinestaticprotected

Definition at line 541 of file SocketImpl.h.

◆ listen()

virtual void Poco::Net::SocketImpl::listen ( int backlog = 64)
virtual

Bind a local IPv6 address to the socket.

This is usually only done when establishing a server socket. TCP clients should not bind a socket to a specific address.

If reuseAddress is true, sets the SO_REUSEADDR socket option.

If reusePort is true, sets the SO_REUSEPORT socket option.

The given address must be an IPv6 address. The IPPROTO_IPV6/IPV6_V6ONLY option is set on the socket according to the ipV6Only parameter.

If the library has not been built with IPv6 support, a Poco::NotImplementedException will be thrown.

◆ operator=()

SocketImpl & Poco::Net::SocketImpl::operator= ( const SocketImpl & )
private

◆ peerAddress()

virtual SocketAddress Poco::Net::SocketImpl::peerAddress ( )
virtual

Returns the IP address and port number of the socket.

+ Here is the caller graph for this function:

◆ poll()

virtual bool Poco::Net::SocketImpl::poll ( const Poco::Timespan & timeout,
int mode )
virtual

Returns the number of bytes available that can be read without causing the socket to block.

+ Here is the caller graph for this function:

◆ receiveBytes() [1/3]

virtual int Poco::Net::SocketImpl::receiveBytes ( Poco::Buffer< char > & buffer,
int flags = 0,
const Poco::Timespan & timeout = 100000 )
virtual

Receives data from the socket and stores it in buffers.

Returns the number of bytes received.

Always returns zero for platforms where not implemented.

◆ receiveBytes() [2/3]

virtual int Poco::Net::SocketImpl::receiveBytes ( SocketBufVec & buffers,
int flags = 0 )
virtual

Receives data from the socket and stores it in buffer. Up to length bytes are received.

Returns the number of bytes received.

Certain socket implementations may also return a negative value denoting a certain condition.

◆ receiveBytes() [3/3]

virtual int Poco::Net::SocketImpl::receiveBytes ( void * buffer,
int length,
int flags = 0 )
virtual

Receives data from the socket and stores it in buffers.

Returns the number of bytes received.

Always returns zero for platforms where not implemented.

◆ receiveFrom() [1/4]

virtual int Poco::Net::SocketImpl::receiveFrom ( SocketBufVec & buffers,
SocketAddress & address,
int flags = 0 )
virtual

Receives data from the socket and stores it in buffer. Up to length bytes are received. Stores the address of the sender in address.

Returns the number of bytes received.

◆ receiveFrom() [2/4]

int Poco::Net::SocketImpl::receiveFrom ( SocketBufVec & buffers,
struct sockaddr ** ppSA,
poco_socklen_t ** ppSALen,
int flags )

Receives data from the socket and stores it in buffers. Stores the address of the sender in address.

Returns the number of bytes received.

Always returns zero for platforms where not implemented.

◆ receiveFrom() [3/4]

virtual int Poco::Net::SocketImpl::receiveFrom ( void * buffer,
int length,
SocketAddress & address,
int flags = 0 )
virtual

Receives data from the socket and stores it in buffer. Up to length bytes are received. Stores the native address of the sender in ppSA, and the length of native address in ppSALen.

Returns the number of bytes received.

◆ receiveFrom() [4/4]

int Poco::Net::SocketImpl::receiveFrom ( void * buffer,
int length,
struct sockaddr ** ppSA,
poco_socklen_t ** ppSALen,
int flags = 0 )

Sends the contents of the buffers through the socket to the given address.

Returns the number of bytes sent, which may be less than the number of bytes specified.

Always returns zero for platforms where not implemented.

◆ reset()

void Poco::Net::SocketImpl::reset ( poco_socket_t fd = POCO_INVALID_SOCKET)
protected

Creates the underlying native socket.

The first argument, af, specifies the address family used by the socket, which should be either AF_INET or AF_INET6.

The second argument, type, specifies the type of the socket, which can be one of SOCK_STREAM, SOCK_DGRAM or SOCK_RAW.

The third argument, proto, is normally set to 0, except for raw sockets.

◆ secure()

virtual bool Poco::Net::SocketImpl::secure ( ) const
virtual

Returns the blocking mode of the socket. This method will only work if the blocking modes of the socket are changed via the setBlocking method!

+ Here is the caller graph for this function:

◆ sendBytes() [1/2]

virtual int Poco::Net::SocketImpl::sendBytes ( const SocketBufVec & buffers,
int flags = 0 )
virtual

Sends the contents of the given buffer through the socket.

Returns the number of bytes sent, which may be less than the number of bytes specified.

Certain socket implementations may also return a negative value denoting a certain condition.

◆ sendBytes() [2/2]

virtual int Poco::Net::SocketImpl::sendBytes ( const void * buffer,
int length,
int flags = 0 )
virtual

Shuts down both the receiving and the sending part of the socket connection.

◆ sendTo() [1/2]

virtual int Poco::Net::SocketImpl::sendTo ( const SocketBufVec & buffers,
const SocketAddress & address,
int flags = 0 )
virtual

Sends the contents of the given buffer through the socket to the given address.

Returns the number of bytes sent, which may be less than the number of bytes specified.

◆ sendTo() [2/2]

virtual int Poco::Net::SocketImpl::sendTo ( const void * buffer,
int length,
const SocketAddress & address,
int flags = 0 )
virtual

Receives data from the socket and stores it in the buffer. If needed, the buffer will be resized to accomodate the data. Note that this function may impose additional performance penalties due to the check for the available amount of data.

Returns the number of bytes received.

◆ sendUrgent()

virtual void Poco::Net::SocketImpl::sendUrgent ( unsigned char data)
virtual

Receives data from the socket and stores it in buffers. Stores the native address of the sender in ppSA, and the length of native address in ppSALen.

Returns the number of bytes received.

◆ setBlocking()

virtual void Poco::Net::SocketImpl::setBlocking ( bool flag)
virtual

Returns the value of the SO_BROADCAST socket option.

+ Here is the caller graph for this function:

◆ setBroadcast()

void Poco::Net::SocketImpl::setBroadcast ( bool flag)

Returns the value of the SO_OOBINLINE socket option.

◆ setKeepAlive()

void Poco::Net::SocketImpl::setKeepAlive ( bool flag)

Returns the value of the TCP_NODELAY socket option.

+ Here is the caller graph for this function:

◆ setLinger()

void Poco::Net::SocketImpl::setLinger ( bool on,
int seconds )

Returns the value of the socket option specified by level and option.

+ Here is the caller graph for this function:

◆ setNoDelay()

void Poco::Net::SocketImpl::setNoDelay ( bool flag)

Returns the value of the SO_LINGER socket option.

+ Here is the caller graph for this function:

◆ setOOBInline()

void Poco::Net::SocketImpl::setOOBInline ( bool flag)

Returns the value of the SO_REUSEPORT socket option.

Returns false if the socket implementation does not support SO_REUSEPORT.

+ Here is the caller graph for this function:

◆ setOption() [1/5]

void Poco::Net::SocketImpl::setOption ( int level,
int option,
const IPAddress & value )

Sets the socket option specified by level and option to the given time value.

+ Here is the caller graph for this function:

◆ setOption() [2/5]

void Poco::Net::SocketImpl::setOption ( int level,
int option,
const Poco::Timespan & value )

Sets the socket option specified by level and option to the given integer value.

+ Here is the caller graph for this function:

◆ setOption() [3/5]

void Poco::Net::SocketImpl::setOption ( int level,
int option,
int value )

Returns the IP address and port number of the peer socket.

+ Here is the caller graph for this function:

◆ setOption() [4/5]

void Poco::Net::SocketImpl::setOption ( int level,
int option,
unsigned char value )

Sets the socket option specified by level and option to the given integer value.

+ Here is the caller graph for this function:

◆ setOption() [5/5]

void Poco::Net::SocketImpl::setOption ( int level,
int option,
unsigned value )

Sets the socket option specified by level and option to the given integer value.

+ Here is the caller graph for this function:

◆ setRawOption()

virtual void Poco::Net::SocketImpl::setRawOption ( int level,
int option,
const void * value,
poco_socklen_t length )
virtual

Sets the socket option specified by level and option to the given time value.

◆ setReceiveBufferSize()

virtual void Poco::Net::SocketImpl::setReceiveBufferSize ( int size)
virtual

Returns the size of the send buffer.

The returned value may be different than the value previously set with setSendBufferSize(), as the system is free to adjust the value.

+ Here is the caller graph for this function:

◆ setReceiveTimeout()

virtual void Poco::Net::SocketImpl::setReceiveTimeout ( const Poco::Timespan & timeout)
virtual

Returns the send timeout for the socket.

The returned timeout may be different than the timeout previously set with setSendTimeout(), as the system is free to adjust the value.

+ Here is the caller graph for this function:

◆ setReuseAddress()

void Poco::Net::SocketImpl::setReuseAddress ( bool flag)

Returns the value of the SO_KEEPALIVE socket option.

+ Here is the caller graph for this function:

◆ setReusePort()

void Poco::Net::SocketImpl::setReusePort ( bool flag)

Returns the value of the SO_REUSEADDR socket option.

+ Here is the caller graph for this function:

◆ setSendBufferSize()

virtual void Poco::Net::SocketImpl::setSendBufferSize ( int size)
virtual

Determines the status of the socket, using a call to select().

The mode argument is constructed by combining the values of the SelectMode enumeration.

Returns true if the next operation corresponding to mode will not block, false otherwise.

+ Here is the caller graph for this function:

◆ setSendTimeout()

virtual void Poco::Net::SocketImpl::setSendTimeout ( const Poco::Timespan & timeout)
virtual

Returns the size of the receive buffer.

The returned value may be different than the value previously set with setReceiveBufferSize(), as the system is free to adjust the value.

+ Here is the caller graph for this function:

◆ shutdown()

virtual void Poco::Net::SocketImpl::shutdown ( )
virtual

Shuts down the sending part of the socket connection.

◆ shutdownReceive()

virtual void Poco::Net::SocketImpl::shutdownReceive ( )
virtual

Close the socket.

◆ shutdownSend()

virtual void Poco::Net::SocketImpl::shutdownSend ( )
virtual

Shuts down the receiving part of the socket connection.

◆ socketError()

int Poco::Net::SocketImpl::socketError ( )

Returns true iff the socket's connection is secure (using SSL or TLS).

◆ sockfd()

poco_socket_t Poco::Net::SocketImpl::sockfd ( ) const
inline

Returns the value of the SO_ERROR socket option.

Definition at line 529 of file SocketImpl.h.

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ PollSetImpl

friend class PollSetImpl
friend

Definition at line 522 of file SocketImpl.h.

◆ SecureSocketImpl

friend class SecureSocketImpl
friend

Definition at line 521 of file SocketImpl.h.

◆ Socket

friend class Socket
friend

Definition at line 520 of file SocketImpl.h.

Member Data Documentation

◆ _blocking

bool Poco::Net::SocketImpl::_blocking
private

Definition at line 517 of file SocketImpl.h.

◆ _isBrokenTimeout

bool Poco::Net::SocketImpl::_isBrokenTimeout
private

Definition at line 518 of file SocketImpl.h.

◆ _recvTimeout

Poco::Timespan Poco::Net::SocketImpl::_recvTimeout
private

Definition at line 515 of file SocketImpl.h.

◆ _sndTimeout

Poco::Timespan Poco::Net::SocketImpl::_sndTimeout
private

Definition at line 516 of file SocketImpl.h.

◆ _sockfd

poco_socket_t Poco::Net::SocketImpl::_sockfd
private

Definition at line 514 of file SocketImpl.h.


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