socketserver
TCP/UDP Server Primitives
Functions
| Function | Description |
|---|---|
_srv_byte_at | Internal byte reader. |
_srv_copy | Internal: copy bytes. |
_srv_parse_int | Internal: parse integer from bytes at offset, returns value. |
srv_tcp_new | Create a TCP server handle. |
srv_tcp_start | Start listening (stub — returns -1, would use socket/bind/listen syscalls). |
srv_tcp_accept | Accept a connection (stub — returns -1). |
srv_parse_addr | Parse “host:port” string into a server handle. |
srv_addr_port | Get the port from a server handle. |
srv_addr_host_len | Get the host length from a server handle. |
srv_addr_host | Copy host string to output buffer. Returns length. |
Details
_srv_byte_at
fn _srv_byte_at(buf: &i8, idx: i64) -> i64Internal byte reader.
_srv_copy
fn _srv_copy(dst: &i8, doff: i64, src: &i8, soff: i64, len: i64) -> i64Internal: copy bytes.
_srv_parse_int
fn _srv_parse_int(buf: &i8, off: i64, len: i64) -> i64Internal: parse integer from bytes at offset, returns value.
srv_tcp_new
fn srv_tcp_new(port: i64, backlog: i64) -> &i64Create a TCP server handle.
srv_tcp_start
fn srv_tcp_start(h: &i64) -> i64Start listening (stub — returns -1, would use socket/bind/listen syscalls).
srv_tcp_accept
fn srv_tcp_accept(h: &i64) -> i64Accept a connection (stub — returns -1).
srv_parse_addr
fn srv_parse_addr(buf: &i8, len: i64) -> &i64Parse “host:port” string into a server handle.
srv_addr_port
fn srv_addr_port(h: &i64) -> i64Get the port from a server handle.
srv_addr_host_len
fn srv_addr_host_len(h: &i64) -> i64Get the host length from a server handle.
srv_addr_host
fn srv_addr_host(h: &i64, out: &i8) -> i64Copy host string to output buffer. Returns length.