32#ifndef RCSC_NET_ABSTRACT_SOCKET_H
33#define RCSC_NET_ABSTRACT_SOCKET_H
37#include <boost/scoped_ptr.hpp>
socket class
Definition: abstract_socket.h:48
const HostAddress & localAddress() const
get the local address object
Definition: abstract_socket.h:150
AbstractSocket()
protected constructor to prevent instantiation
HostAddress::PortNumber peerPort() const
get the port number of destination address
Definition: abstract_socket.h:186
bool isOpen() const
check if socket is opened or not.
Definition: abstract_socket.h:135
bool open(const SocketType type)
open socket
bool setPeerAddress(const char *hostname, const HostAddress::PortNumber port)
set the address info of the specified remote host.
const HostAddress & peerAddress() const
get the peer address object
Definition: abstract_socket.h:168
SocketType
socket type definition
Definition: abstract_socket.h:54
HostAddress M_peer_address
destination address
Definition: abstract_socket.h:70
HostAddress M_local_address
local address
Definition: abstract_socket.h:68
virtual ~AbstractSocket()
destructor. close socket automatically
bool bind(const HostAddress::PortNumber port)
bind the socket to local address
int setNonBlocking()
set non blocking mode.
int fd() const
returns socket file descriptor
Definition: abstract_socket.h:89
HostAddress::PortNumber localPort() const
get the port number of destination address
Definition: abstract_socket.h:159
std::string peerName() const
get the host name of destination address
Definition: abstract_socket.h:177
int connectToPresetAddr()
connect to address set by setAddr()
Definition: host_address.h:43
std::uint16_t PortNumber
port number type
Definition: host_address.h:45
std::string toHostName() const
get the address as a string (e.g. "127.0.0.1") that is generated by inet_ntoa.
address class Header File.