Packages

builtin
cbindgen
core
core.alloc
core.alloc.arena
core.alloc.atomic
core.alloc.debug
core.alloc.fixed
core.alloc.gc
core.alloc.heap
core.alloc.log
core.alloc.memwatch
core.alloc.pool
core.alloc.ring
core.arg_parse
core.array
core.avl_tree
core.bucket_array
core.conv
core.crypto
core.crypto.keys
core.doc
core.encoding
core.encoding.base64
core.encoding.csv
core.encoding.hex
core.encoding.json
core.encoding.kdl
core.encoding.osad
core.encoding.utf8
core.encoding.xml
core.hash
core.hash.md5
core.hash.sha1
core.hash.sha256
core.heap
core.intrinsics
core.intrinsics.atomics
core.intrinsics.onyx
core.intrinsics.types
core.intrinsics.wasm
core.io
core.io.binary
core.iter
core.js
core.list
core.map
core.math
core.memory
core.misc
core.net
core.os
core.random
core.set
core.slice
core.string
core.sync
core.test
core.thread
core.time
main
runtime
runtime.info
runtime.platform
runtime.vars
simd

package core.net

ResolveResult
ResolveResult :: struct {
    family: SocketFamily
    type: SocketType
    proto: SocketProto
    addr: SocketAddress
}
Socket
Socket :: struct {
    stream: Stream
    handle: SocketData
    type: SocketType
    family: SocketFamily
    proto: SocketProto
    alive: bool
}
Methods
Socket.accept
Socket.accept :: (s: &Socket) -> Result(SocketAcceptResult, Error)
Socket.bind
Socket.bind :: (s: &Socket, bind_address: &SocketAddress) -> bool
Socket.close
Socket.close :: (s: &Socket) -> void
Socket.connect
Socket.connect :: (s: &Socket, addr: &SocketAddress) -> Error
Socket.is_alive
Socket.is_alive :: (s: &Socket) -> bool
Socket.listen
Socket.listen :: (s: &Socket, backlog: i32) -> bool
Socket.option
Socket.option :: (s: &Socket, setting: SocketOption, flag: bool) -> void
Socket.poll
Socket.poll :: (socket: &Socket, timeout: i32) -> Socket_Poll_Status
Socket.recv
Socket.recv :: (s: &Socket, maxlen: i32, allocator: Allocator) -> ? [] u8
Socket.recv_into
Socket.recv_into :: (s: &Socket, buffer: [] u8) -> i32
Socket.recvfrom
Socket.recvfrom :: (s: &Socket, buffer: [] u8) -> ? SocketRecvFromResult
Socket.send
Socket.send :: (s: &Socket, data: [] u8) -> i32
Socket.sendall
Socket.sendall :: (s: &Socket, data: [] u8) -> void
Socket.sendto
Socket.sendto :: (s: &Socket, data: [] u8, addr: &SocketAddress) -> i32
Socket.shutdown
Socket.shutdown :: (s: &Socket, how: SocketShutdown) -> Error
SocketAcceptResult
SocketAcceptResult :: struct {
    socket: Socket
    addr: SocketAddress
}
SocketRecvFromResult
SocketRecvFromResult :: struct {
    addr: SocketAddress
    count: i32
}
TCP_Client
TCP_Client :: struct {
    connection: TCP_Connection
}
TCP_Connection
TCP_Connection :: struct {
    socket: Socket
    event_allocator: Allocator
    events: [..] TCP_Event
    event_cursor: i32
}
Methods
TCP_Connection.iter_close
TCP_Connection.iter_close :: (conn: &TCP_Connection) -> void
TCP_Connection.iter_next
TCP_Connection.iter_next :: (conn: &TCP_Connection) -> ? TCP_Event
TCP_Connection.iter_open
TCP_Connection.iter_open :: (conn: &TCP_Connection) -> void
TCP_Event
TCP_Event :: struct {
    kind: TCP_Event.Kind
    data: rawptr
}
TCP_Server
TCP_Server :: struct {
    connection: TCP_Connection
    clients: [] ? Client
    client_count: u32
    alive: bool
    pulse_time_ms: i32
    emit_data_events: bool
    emit_ready_event_multiple_times: bool
}
Methods
TCP_Server.broadcast
TCP_Server.broadcast :: (server: &TCP_Server, data: [] u8, except: &Client) -> void
TCP_Server.event_iter
TCP_Server.event_iter :: (server: &TCP_Server) -> Iterator(TCP_Event)
TCP_Server.handle_events
TCP_Server.handle_events :: macro (server: &TCP_Server, handler: Code) -> void
TCP_Server.kill_client
TCP_Server.kill_client :: (server: &TCP_Server, client: &Client) -> void
TCP_Server.listen
TCP_Server.listen :: (server: &TCP_Server, port: u16) -> bool
TCP_Server.pulse
TCP_Server.pulse :: (server: &TCP_Server) -> bool
TCP_Server.send
TCP_Server.send :: (server: &TCP_Server, client: &Client, data: [] u8) -> void
TCP_Server.stop
TCP_Server.stop :: (server: &TCP_Server) -> void
TCP_Server.transfer_client
TCP_Server.transfer_client :: (server: &TCP_Server, client: &Client, other_server: &TCP_Server) -> ? Client
SocketFamily
SocketFamily :: enum {
    Unknown :: 0
    Inet :: 1
    Inet6 :: 2
    Unix :: 3
}
SocketOption
SocketOption :: enum {
    NonBlocking :: 1
    Broadcast :: 2
    ReuseAddress :: 3
}
SocketProto
SocketProto :: enum {
    ANY :: 0
    IP :: 0
    ICMP :: 1
    IGMP :: 2
    TCP :: 6
    UDP :: 17
    IPV6 :: 41
}
SocketShutdown
SocketShutdown :: enum {
    Read :: 0
    Write :: 1
    ReadWrite :: 2
}
SocketStatus
SocketStatus :: enum {
    Unknown :: 0
    Opening :: 1
    Open :: 2
    Closed :: 3
    Errored :: 4
}
SocketType
SocketType :: enum {
    Stream :: 0
    Dgram :: 1
}
Socket_Poll_Status
Socket_Poll_Status :: enum {
    No_Change :: 0
    Readable :: 1
    Closed :: 2
}
SocketAddress
SocketAddress :: union {
    Unix: [256] u8
    Inet: 
    Inet6: 
    HostPort: 
}
Methods
SocketAddress.addr_as_str
SocketAddress.addr_as_str :: (this: &SocketAddress, allocator: Allocator) -> [] u8
dial
dial :: (host: [] u8, port: u16, type: SocketType) -> Result(Socket, Error)
ipv4_to_str
ipv4_to_str :: (addr: u32) -> [] u8
ipv6_to_str
ipv6_to_str :: (addr: [16] u8) -> [] u8
make_ipv4_address
make_ipv4_address :: (addr: [] u8, port: u16) -> SocketAddress
make_ipv4_address :: (out: &SocketAddress, addr: [] u8, port: u16) -> void
make_unix_address
make_unix_address :: (out: &SocketAddress, path: [] u8) -> void
resolve
resolve :: (host: [] u8, port: u16, max_results: i32) -> [] ResolveResult
socket_accept
socket_accept :: (s: &Socket) -> Result(SocketAcceptResult, Error)
socket_bind
socket_bind :: (s: &Socket, bind_address: &SocketAddress) -> bool
socket_close
socket_close :: (s: &Socket) -> void
socket_connect
socket_connect :: (s: &Socket, addr: &SocketAddress) -> Error
socket_create
socket_create :: (family: SocketFamily, type: SocketType, proto: SocketProto) -> Result(Socket, Error)
socket_from_fd
socket_from_fd :: (fd: SocketData) -> Socket
socket_is_alive
socket_is_alive :: (s: &Socket) -> bool
socket_listen
socket_listen :: (s: &Socket, backlog: i32) -> bool
socket_option
socket_option :: (s: &Socket, setting: SocketOption, flag: bool) -> void
socket_poll
socket_poll :: (socket: &Socket, timeout: i32) -> Socket_Poll_Status
socket_poll_all
socket_poll_all :: (sockets: [] &Socket, stat_buff: [] Socket_Poll_Status, timeout: i32) -> void
socket_recv
socket_recv :: (s: &Socket, maxlen: i32, allocator: Allocator) -> ? [] u8
socket_recv_into
socket_recv_into :: (s: &Socket, buffer: [] u8) -> i32
socket_recvfrom
socket_recvfrom :: (s: &Socket, buffer: [] u8) -> ? SocketRecvFromResult
socket_send
socket_send :: (s: &Socket, data: [] u8) -> i32
socket_sendall
socket_sendall :: (s: &Socket, data: [] u8) -> void
socket_sendto
socket_sendto :: (s: &Socket, data: [] u8, addr: &SocketAddress) -> i32
socket_shutdown
socket_shutdown :: (s: &Socket, how: SocketShutdown) -> Error
str_to_ipv4
str_to_ipv4 :: (ip: [] u8) -> u32
tcp_server_broadcast
tcp_server_broadcast :: (server: &TCP_Server, data: [] u8, except: &Client) -> void
tcp_server_event_iter
tcp_server_event_iter :: (server: &TCP_Server) -> Iterator(TCP_Event)
tcp_server_handle_events
tcp_server_handle_events :: macro (server: &TCP_Server, handler: Code) -> void
tcp_server_kill_client
tcp_server_kill_client :: (server: &TCP_Server, client: &Client) -> void
tcp_server_listen
tcp_server_listen :: (server: &TCP_Server, port: u16) -> bool
tcp_server_make
tcp_server_make :: (max_clients: i32, allocator: Allocator) -> &TCP_Server
tcp_server_pulse
tcp_server_pulse :: (server: &TCP_Server) -> bool
tcp_server_send
tcp_server_send :: (server: &TCP_Server, client: &Client, data: [] u8) -> void
tcp_server_stop
tcp_server_stop :: (server: &TCP_Server) -> void
tcp_server_transfer_client
tcp_server_transfer_client :: (server: &TCP_Server, client: &Client, other_server: &TCP_Server) -> ? Client