tanya.net.socket

Low-level socket programming.

Current API supports only server-side TCP communication.

For an example of an asynchronous server refer to the documentation of the $(D_PSYMBOL tanya.async.loop) module.

Public Imports

std.socket
public import std.socket : SocketOption, SocketOptionLevel;
tanya.sys.windows.winbase
public import tanya.sys.windows.winbase;
tanya.sys.windows.winsock2
public import tanya.sys.windows.winsock2;

Members

Classes

ConnectedSocket
class ConnectedSocket

Socket returned if a connection has been established.

OverlappedConnectedSocket
class OverlappedConnectedSocket

Socket returned if a connection has been established.

OverlappedStreamSocket
class OverlappedStreamSocket

Windows stream socket overlapped I/O.

Socket
class Socket

Class for creating a network communication endpoint using the Berkeley sockets interfaces of different types.

SocketException
class SocketException

$(D_PSYMBOL SocketException) should be thrown only if one of the socket functions $(D_PSYMBOL socketError) and sets $(D_PSYMBOL errno), because $(D_PSYMBOL SocketException) relies on the $(D_PSYMBOL errno) value.

SocketState
class SocketState
Undocumented in source.
StreamSocket
class StreamSocket
Undocumented in source.

Enums

OverlappedSocketEvent
enum OverlappedSocketEvent
Undocumented in source.
SocketType
enum SocketType
Undocumented in source.
SocketType
enum SocketType
Undocumented in source.

Functions

accept4
int accept4(int , sockaddr* , socklen_t* , int flags)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
wouldHaveBlocked
bool wouldHaveBlocked()

Checks if the last error is a serious error or just a special behaviour error of non-blocking sockets (for example an error returned because the socket would block or because the asynchronous operation was successfully started but not finished yet).

Interfaces

ConnectionOrientedSocket
interface ConnectionOrientedSocket

Interface with common fileds for stream and connected sockets.

Manifest constants

ESOCKTNOSUPPORT
enum ESOCKTNOSUPPORT;
Undocumented in source.
SOCK_NONBLOCK
enum SOCK_NONBLOCK;
Undocumented in source.

Structs

Linger
struct Linger

Socket option that specifies what should happen when the socket that promises reliable delivery still has untransmitted messages when it is closed.

Variables

socketError
enum int socketError;

Value returned by socket operations on error.

Meta