Module arceos_api::net
source · Expand description
Networking primitives for TCP/UDP communication.
Structs
- A handle to a TCP socket.
- A handle to a UDP socket.
Functions
- ax_dns_query
net
Resolves the host name to a list of IP addresses. - Poll the network stack.
- Accepts a new connection on the TCP socket.
- ax_tcp_bind
net
Binds the TCP socket to the given address and port. - Connects the TCP socket to the given address and port.
- Starts listening on the bound address and port.
- Returns the remote address and port of the TCP socket.
- ax_tcp_poll
net
Returns whether the TCP socket is readable or writable. - ax_tcp_recv
net
Receives data on the TCP socket, and stores it in the given buffer. On success, returns the number of bytes read. - ax_tcp_send
net
Transmits data in the given buffer on the TCP socket. - Moves this TCP socket into or out of nonblocking mode.
- Closes the connection on the TCP socket.
- Creates a new TCP socket.
- Returns the local address and port of the TCP socket.
- ax_udp_bind
net
Binds the UDP socket to the given address and port. - Connects this UDP socket to a remote address, allowing the
send
andrecv
to be used to send data and also applies filters to only receive data from the specified address. - Receives a single datagram message on the UDP socket, without removing it from the queue.
- Returns the remote address and port of the UDP socket.
- ax_udp_poll
net
Returns whether the UDP socket is readable or writable. - ax_udp_recv
net
Receives a single datagram message on the UDP socket from the remote address to which it is connected. On success, returns the number of bytes read. - Receives a single datagram message on the UDP socket.
- ax_udp_send
net
Sends data on the UDP socket to the remote address to which it is connected. - Sends data on the UDP socket to the given address. On success, returns the number of bytes written.
- Moves this UDP socket into or out of nonblocking mode.
- Creates a new UDP socket.
- Returns the local address and port of the UDP socket.