Creator. Param: socket type
Unsubscrbe all subscribed
Terminate, wait and close
Create and start dialer
Create dialer
Assign NNGTLS to dialer
Start dialer
Create and start listener
Create listener Param: URL
Add NNGTLS to listener
Start listener
Receives a data type (castable to byte array) as postallocated buffer
Receive NNGMessage with AIO Returns zero or error code
Receives a data buffer of the max size data.length
Receives NNGMessage
Send any array type Returns zero or error code
Send NNGMessage with AIO Returns zero or error code
Send NNGMessage Returns zero or error code
Subscribe SUB socket to tag
Returns list of subscriptions
Unsubscribe SUB socket from tag
MAXTTL a value between 0 and 255, inclusive. Where 0 is infinite
{NNGSocket} The main socket wrapper Socket may be created of one of the above described types Most types has dialer-listener pairs: PUSH/PULL, REQ/REP, PUB/SUB... Methods: - constructor -- type -- raw flag (see NNG doc) - close: close socket, wait for status changes
@setup listener - listen: bind listener to URL (addres, port, proto etc) (listener_create + listener_start) -- URL like "tcp://...", "ipc://...", "udp://...", "ws://...." -- nonblock flag (see NNG doc) - listener_create: create but not start ( for aio and tls ) -- URL - listener_set_tls: attach the prepared NNGTLS - listener_start: do listen
@setup dialer - dial: try connect to remote lustener (dialer_create + dialer_start) -- URL -- nonblock flag - dialer_create -- URL - dialer_set_tls: attach the prepared NNGTLS - dialer_start: do dial
@setup sbscription ( for SUB only ) - subscribe -- tag - unsubscribe -- tag - clear_subscriptions: unsubscribe all - subscriptions: return list of subscriptions
@send&receive - sendmsg -- NNGMessage message - send(template): send any type or array - sendaio: async send with poller -- NNGAio with previously added NNGMessage - receivebuf -- ubute[] buffer -- size - receivemsg -- NNGMessage - reveive (template): receive any type or array - receiveaio: async receive with wait poller
Properties:
- state: curent state like NEW, ERROR, CONNECTED... - errno: last error - type: socket type - name: socket name - raw: raw flag
NNG properties:
There are dozens properties of several scopes - socket, listener, dialer, protocol, etc. See NNG docs. Currently implemented; - proto - protoname - peer - peername - recvbuf - sendbuf - recvfd - recvtimeout - sendtimeout - locaddr - remaddr - url - maxttl - recvmaxsz - reconnmint - reconnmaxt