std1.0.0-beta-7 SafeC docs

std :: async::net

Struct std::AsyncTcpListener

#include <std/async/net.h> source

struct AsyncTcpListener {
    int fd;
}

Fields

§int fdsource

< 0: bind/listen failed

Methods

§static struct AsyncTcpListener bind(unsigned short port)source · definition

Listen on 'port' (0: any free port; see local_port) on every interface.

§struct AcceptFut accept()source · definition

Ready with the next connection (its .fd < 0 on an error).

§unsigned short local_port() constsource · definition

The port it listens on.

§int close() consumesource · definition
§void drop()source · definition

close(), ignoring the result