AddressIPSocket

IP socket class, memorises the address most recently passed to bind() or connect() or obtained by accept().

Members

Functions

accept
int accept(ISelectable listening_socket, InAddr remote_address, bool nonblocking)

Calls accept() to accept a connection from a listening socket, sets this.fd to the accepted socket file descriptor and memorises the remote address and port.

accept
int accept(ISelectable listening_socket, SocketFlags flags)

Calls accept() to accept a connection from a listening socket, sets this.fd to the accepted socket file descriptor and memorises the remote address and port.

accept
int accept(ISelectable listening_socket, InAddr remote_address, SocketFlags flags)

Calls accept() to accept a connection from a listening socket, sets this.fd to the accepted socket file descriptor and memorises the remote address and port.

accept
int accept(ISelectable listening_socket, bool nonblocking)

Calls accept() to accept a connection from a listening socket, sets this.fd to the accepted socket file descriptor and memorises the remote address and port.

address
cstring address()

Obtains the IP address most recently passed to bind() or connect() or obtained by accept().

bind
int bind(cstring local_ip_address, ushort local_port)

Assigns a local address and optionally a port to this socket and memorises address and port. This socket needs to have been created by socket().

bind
int bind(ushort local_port)

Assigns the wildcard "any" local address and optionally a port to this socket and memorises address and port. This socket needs to have been created by socket().

connect
int connect(cstring remote_ip_address, ushort remote_port)

Connects this socket the specified address and port and memorises address and port. This socket needs to have been created by socket().

connect
int connect(InAddr remote_address)

Connects this socket the specified address memorises and it. This socket needs to have been created by socket().

connected
bool connected()
fileHandle
Handle fileHandle()

IAddressIPSocketInfo interface method. Wrapper for method implemented by super class.

in_addr
InAddr in_addr()

Obtains the address most recently passed to bind() or connect() or obtained by accept().

port
ushort port()

Obtains the port number most recently passed to bind() or connect() or obtained by accept().

updateAddress
int updateAddress()

Asks the operating system what address & port this socket is actually bound to and updates the internal buffers accordingly.

Inherited Members

From IAddressIPSocketInfo

connected
bool connected()
fileHandle
ISelectable.Handle fileHandle()
address
cstring address()

Obtains the IP address most recently passed to bind() or connect() or obtained by accept().

port
ushort port()

Obtains the port number most recently passed to bind() or connect() or obtained by accept().

Parameters

IPv6

true: use IPv6, false: use IPv4

Meta