12345678910111213141516171819202122232425262728293031323334353637module juptune.event.io;
struct PosixTcpSocket
{
/++ ALIASES ++/
///
alias __xdtor = __MARMOS_BUG__;
///
alias __xpostblit = __MARMOS_BUG__;
/++ FUNCTIONS ++/
/// Accepts a client socket from a listening server socket.
Result accept(PosixTcpSocket client);
/// Connects to the target address.
Result connect(const const char[] address, bool lookupWasPerformed, ushort defaultPort = cast(ushort)0u);
/// Connects to the target address.
Result connect(IpAddress address);
/// The IP address of this socket.
IpAddress ip();
/// Binds the socket to an address, and begins listening for connections.
Result listen(const const char[] address, uint backlog, ushort defaultPort = cast(ushort)0u);
/// Binds the socket to an address, and begins listening for connections.
Result listen(IpAddress address, uint backlog);
///
static Result makePair(PosixTcpSocket[2LU] sockets);
///
PosixTcpSocket opAssign(PosixTcpSocket p);
/// Creates the underlying socket.
Result open();
/++ VARIABLES ++/
///
GenericIoDriver!(FileDescriptorReadWriteType.sendAndRecieve) _driver;
}
Implementations
A TcpSocketimplementation that uses the standard POSIX socket functions for when io_uring doesn't provide a native opcode.
When a function has to use a standard POSIX function instead of io_uring, it may block the thread.
As with all IO Driver implementations, this struct inherits GenericIoDriverfor common IO functions.
GenericIoDriver
| Name | Description |
|---|---|
| __xdtor | |
| __xpostblit |
| Name | Description |
|---|---|
| accept |
Accepts a client socket from a listening server socket. |
| connect |
Connects to the target address. |
| connect |
Connects to the target address. |
| ip |
The IP address of this socket. |
| listen |
Binds the socket to an address, and begins listening for connections. |
| listen |
Binds the socket to an address, and begins listening for connections. |
| makePair | |
| opAssign | |
| open |
Creates the underlying socket. |
| Name | Description |
|---|---|
| _driver |