Class: NanoMsg::SubSocket
Instance Method Summary collapse
- #initialize ⇒ Object constructor
- #subscribe(channel) ⇒ Object
Methods inherited from Socket
#bind, #close, #connect, #recv, #send, #setsockopt
Constructor Details
#initialize ⇒ Object
Instance Method Details
#subscribe(channel) ⇒ Object
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
# File 'ext/init.c', line 318
static VALUE
sub_sock_subscribe(VALUE socket, VALUE channel)
{
int sock = sock_get(socket);
int err;
err = nn_setsockopt(
sock, NN_SUB, NN_SUB_SUBSCRIBE,
StringValuePtr(channel),
RSTRING_LEN(channel)
);
if (err < 0)
RAISE_SOCK_ERROR;
return socket;
}
|