std1.0.0-beta-7 SafeC docs

std :: async::net

Struct std::AsyncTcpStream

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

struct AsyncTcpStream {
    int fd;
}

Fields

§int fdsource

< 0: not connected (a failed connect/accept)

Methods

§static struct AsyncTcpStream from_fd(int fd)source · definition
§static struct ConnectFut connect(unsigned int addr_network_order, unsigned short port)source · definition
§struct ReadFut read([]unsigned char buf)source · definition

Up to buf.len bytes: the count, 0 once the peer closed, -1 on error.

§struct WriteFut write([]const unsigned char buf)source · definition

Some of buf: the count written, -1 on error.

§struct WriteAllFut write_all([]const unsigned char buf)source · definition

All of buf: 1 when written, 0 on error.

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

close(), ignoring the result

§int is_open() constsource · definition