p2  0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Aio_udp Class Reference

create and init a Aio_udp object More...

Public Member Functions

static PN aio_udp_get (Potion *P, PN cl, PN self, PN key, PN value)
 
static PN aio_udp_set (Potion *P, PN cl, PN self, PN key, PN value)
 
static PN aio_udp_open (Potion *P, PN cl, PN udp, PN sockfd)
 
static PN aio_udp_bind (Potion *P, PN cl, PN udp, PN addr, PN port, PN flags)
 
static PN aio_udp_bind6 (Potion *P, PN cl, PN udp, PN addr, PN port, PN flags)
 
static PN aio_udp_getsockname (Potion *P, PN cl, PN udp)
 
static PN aio_udp_set_membership (Potion *P, PN cl, PN udp, PN mcaddr, PN ifaddr, PN membership)
 
static PN aio_udp_set_multicast_loop (Potion *P, PN cl, PN udp, PN on)
 
static PN aio_udp_set_multicast_ttl (Potion *P, PN cl, PN udp, PN ttl)
 
static PN aio_udp_set_broadcast (Potion *P, PN cl, PN udp, PN on)
 
static PN aio_udp_set_ttl (Potion *P, PN cl, PN udp, PN ttl)
 
static PN aio_udp_send (Potion *P, PN cl, PN udp, PN req, PN buf, PN bufcnt, PN addr, PN port, PN cb)
 
static PN aio_udp_send6 (Potion *P, PN cl, PN udp, PN req, PN buf, PN bufcnt, PN addr, PN port, PN cb)
 
static void aio_udp_recv_cb (uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf, const struct sockaddr *addr, unsigned flags)
 
static PN aio_udp_recv_start (Potion *P, PN cl, PN udp, PN cb)
 
static PN aio_udp_recv_stop (Potion *P, PN cl, PN udp)
 

Detailed Description

create and init a Aio_udp object

Parameters
loopPNAioLoop to uv_loop_t*, defaults to uv_default_loop()
See also
http://nikhilm.github.io/uvbook/networking.html#udp

Member Function Documentation

static PN aio_udp_get ( Potion P,
PN  cl,
PN  self,
PN  key,
PN  value 
)

get Aio_udp properties

Parameters
keyPNString, One of "broadcast", "multicast_loop", "multicast_ttl", "ttl"
See also
http://nikhilm.github.io/uvbook/networking.html#udp

Definition at line 280 of file aio.c.

static PN aio_udp_set ( Potion P,
PN  cl,
PN  self,
PN  key,
PN  value 
)

set Aio_udp properties

Parameters
keyPNString, One of "broadcast", "multicast_loop", "multicast_ttl", "ttl", "membership"
value
See also
http://nikhilm.github.io/uvbook/networking.html#udp

Definition at line 293 of file aio.c.

static PN aio_udp_open ( Potion P,
PN  cl,
PN  udp,
PN  sockfd 
)
Returns
aio_udp or nil

Definition at line 930 of file aio.c.

static PN aio_udp_bind ( Potion P,
PN  cl,
PN  udp,
PN  addr,
PN  port,
PN  flags 
)

Definition at line 938 of file aio.c.

static PN aio_udp_bind6 ( Potion P,
PN  cl,
PN  udp,
PN  addr,
PN  port,
PN  flags 
)

Definition at line 958 of file aio.c.

static PN aio_udp_getsockname ( Potion P,
PN  cl,
PN  udp 
)

Definition at line 971 of file aio.c.

static PN aio_udp_set_membership ( Potion P,
PN  cl,
PN  udp,
PN  mcaddr,
PN  ifaddr,
PN  membership 
)

Definition at line 979 of file aio.c.

static PN aio_udp_set_multicast_loop ( Potion P,
PN  cl,
PN  udp,
PN  on 
)

Definition at line 992 of file aio.c.

static PN aio_udp_set_multicast_ttl ( Potion P,
PN  cl,
PN  udp,
PN  ttl 
)

Definition at line 1002 of file aio.c.

static PN aio_udp_set_broadcast ( Potion P,
PN  cl,
PN  udp,
PN  on 
)

Definition at line 1011 of file aio.c.

static PN aio_udp_set_ttl ( Potion P,
PN  cl,
PN  udp,
PN  ttl 
)

Definition at line 1021 of file aio.c.

static PN aio_udp_send ( Potion P,
PN  cl,
PN  udp,
PN  req,
PN  buf,
PN  bufcnt,
PN  addr,
PN  port,
PN  cb 
)

Definition at line 1031 of file aio.c.

static PN aio_udp_send6 ( Potion P,
PN  cl,
PN  udp,
PN  req,
PN  buf,
PN  bufcnt,
PN  addr,
PN  port,
PN  cb 
)

Definition at line 1050 of file aio.c.

static void aio_udp_recv_cb ( uv_udp_t *  handle,
ssize_t  nread,
const uv_buf_t *  buf,
const struct sockaddr *  addr,
unsigned  flags 
)

This callback is invoked when a new UDP datagram is received.

Parameters
handleaio_udp handle
nreadint Number of bytes that have been received. 0 if there is no more data to read. You may discard or repurpose the read buffer. -1 if a transmission error was detected.
bufPNBytes with the received data
addrPNString
portPNInteger
flagsPNInteger, One or more OR'ed AIO_UDP_* constants, so far only AIO_UDP_PARTIAL is used.
See also
http://nikhilm.github.io/uvbook/networking.html#udp

Definition at line 1090 of file aio.c.

static PN aio_udp_recv_start ( Potion P,
PN  cl,
PN  udp,
PN  cb 
)

Definition at line 1116 of file aio.c.

static PN aio_udp_recv_stop ( Potion P,
PN  cl,
PN  udp 
)

Definition at line 1124 of file aio.c.


The documentation for this class was generated from the following file: