IPSocket

IP socket class, contains the IPv4/6 address specific parts.

Constructors

this
this()

Constructor.

Members

Aliases

InAddr
alias InAddr = InetAddress.Addr

Type alias of the "sin" internet address struct type, sockaddr_in for IPv4 or sockaddr_in6 for IPv6.

InetAddress
alias InetAddress = .InetAddress!(IPv6)
Undocumented in source.

Functions

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

Accepts a connection from a listening socket and sets this.fd to the accepted socket file descriptor.

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.

accept
int accept(ISelectable listening_socket, sockaddr* remote_address, socklen_t addrlen, SocketFlags flags)

Overriding wrapper to satisfy overload-override rules of D.

bind
int bind(InAddr local_address)

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

bind
int bind(cstring local_ip_address, ushort local_port)

Assigns a local address and optionally a port to this socket. 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. This socket needs to have been created by socket().

bind
int bind(sockaddr* local_address)

Overriding wrapper to satisfy overload-override rules of D.

connect
int connect(InAddr remote_address)

Connects this socket the specified address. 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. This socket needs to have been created by socket().

connect
int connect(sockaddr* remote_address)

Overriding wrapper to satisfy overload-override rules of D.

formatInfo
void formatInfo(char[] buf, bool io_error)

Formats information about the socket into the provided buffer.

getpeername
int getpeername(InAddr remote_address)

Obtains the address of the peer connected to this socket.

getpeername
int getpeername(sockaddr* remote_address, socklen_t addrlen)

Overriding wrapper to satisfy overload-override rules of D.

getsockname
int getsockname(InAddr local_address)

Obtains the current address to which this socket is bound.

getsockname
int getsockname(sockaddr* local_address, socklen_t addrlen)

Overriding wrapper to satisfy overload-override rules of D.

Inherited Members

From IIPSocket

socket
alias socket = ISocket.socket
Undocumented in source.
SocketFlags
alias SocketFlags = .SocketFlags

Flags supported by accept4().

TcpOptions
alias TcpOptions = .TcpOptions
Undocumented in source.
is_ipv6
bool is_ipv6()

true for IPv6, false for IPv4.

socket
int socket(int type, int protocol)

Creates an IP socket endpoint for communication and sets this.fd to the corresponding file descriptor.

tcpSocket
int tcpSocket(bool nonblocking)

Calls socket() to create a TCP/IP socket, setting this.fd to the file descriptor.

Parameters

IPv6

true: use IPv6, false: use IPv4

Meta