Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Structs PosixTcpSocket

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
module 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;
}

Documentation

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.

See_Also

GenericIoDriver

Aliases

Name Description
__xdtor
__xpostblit

Functions

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.

Variables

Name Description
_driver