Peer

A Single active socket connection All aio tasks notify the calling thread by sending a message

@safe
struct Peer {
uint id;
string owner_task;
State state;
nng_stream* socket;
nng_aio* aio;
nng_iov iov;
ubyte[] msg_buf;
size_t bufsize;
}

Constructors

this
this(uint id, nng_stream* socket, size_t bufsize)

Destructor

~this
~this()

free nng memory

Postblit

this(this)
this(this)

copy/postblit disabled

Members

Functions

recv
void recv()

Receive a buffer from the peer

send
void send(const(ubyte)[] data)

Send a buffer to the peer