#include <ipsocket.h>
Inheritance diagram for sockets::IPSocket:
Public Member Functions | |
IPSocket (int type=0, int protocol=0) | |
Constructor. | |
IPSocket (IPSocket const &ips) | |
Copy constructor. | |
virtual IPSocket & | operator= (IPSocket const &right) |
Assignment operator. | |
~IPSocket () | |
Destructor. | |
virtual bool | assign (int fd, uint32_t status) |
Assigns a socket file descriptor. | |
virtual bool | bind () |
Binds the socket. | |
virtual bool | set_local (char const *address, char const *port, char const **error=0) |
Sets local address and port. | |
virtual bool | set_local (char const *address, unsigned short port, char const **error=0) |
Same as the other set_local(), but port is an integer. | |
virtual bool | set_remote (char const *address, char const *port, char const **error=0) |
Sets remote address and port. | |
virtual bool | set_remote (char const *address, unsigned short port, char const **error=0) |
Same as the other set_remote(), but port is an integer. | |
virtual char const * | laddress () const |
Returns the local address. | |
virtual unsigned short | lport () const |
Returns the local port. | |
virtual char const * | raddress () const |
Returns the remote address. | |
virtual unsigned short | rport () const |
Returns the remote port. | |
Protected Member Functions | |
virtual bool | create () |
Overrides Socket::create() to set the socket as non-blocking. | |
bool | resolve (char const *address, char const *port, char const **error, IPInfo **ipi) |
Resolves an address and port. | |
IPInfo * | local () |
Returns the local information. | |
IPInfo const * | local () const |
Returns the local information. | |
IPInfo * | remote () |
Returns the remote information. | |
IPInfo const * | remote () const |
Returns the remote information. | |
unsigned short | port (IPInfo const *ipi) const |
Returns the port out of an IPInfo object. | |
Classes | |
class | IPInfo |
IP information class. More... |
This class provides support to set up and retrieve information about the local and remote end of a connection, as well as a function to bind the socket to a specific address and/or port.
Both IPv4 and IPv6 are supported.
|
Constructor.
|
|
Assigns a socket file descriptor to the socket object, that is then used by the object for all operations on the socket. This function overrides Socket::assign() to set the socket as non-blocking.
Reimplemented from sockets::Socket. Reimplemented in sockets::TCPClient. |
|
Binds the socket to the local address and port that have been specified through the set_local() function. This function creates the socket file descriptor if it is not created already. The ssCreated and ssBound flags are guaranteed to be set if this function succeeds.
|
|
Returns the local address. This is either the address set through the set_local() function if it was used, or the one the socket is actually bound to if the ssCreated status flag is set and ssLocalInfo is not.
|
|
Returns the local port. This is the port set through the set_local() function if it was used, or the one the socket is actually bound to if the ssCreated status flag is set and ssLocalInfo is not.
|
|
Returns the remote address. This is the address set through the set_remote() function.
Reimplemented in sockets::TCPSocket. |
|
Resolves an address and port.
|
|
Returns the remote port. This is the port set through the set_remote() function.
Reimplemented in sockets::TCPSocket. |
|
Sets local address and port. It can't be changed once the ssBound, ssListening, ssConnecting or ssConnected status flags are set on the socket. This function determines the socket protocol family if the ssRemoteInfo and ssCreated status flags are not set on the socket.
|
|
Sets remote address and port. It can't be changed once the ssListening, ssConnecting or ssConnected status flags are set on the socket. This function determines the socket protocol family if the ssLocalInfo and ssCreated status flags are not set on the socket.
Reimplemented in sockets::TCPSocket. |