Module: NanoMsg

Defined in:
lib/nanomsg.rb,
lib/nanomsg/pair_socket.rb,
ext/init.c

Defined Under Namespace

Classes: BusSocket, PairSocket, PubSocket, PullSocket, PushSocket, RepSocket, ReqSocket, RespondSocket, Socket, SocketError, SubSocket, SurveySocket

Class Method Summary collapse

Class Method Details

.run_device(a, b) ⇒ Object



407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'ext/init.c', line 407

static VALUE
nanomsg_run_device(VALUE self, VALUE a, VALUE b)
{
  struct device_op dop; 

  dop.sa = sock_get(a);
  dop.sb = sock_get(b);

  WITHOUT_GVL(nanomsg_run_device_no_gvl, &dop, RUBY_UBF_IO, 0);
  if (dop.err < 0)
    RAISE_SOCK_ERROR;

  return Qnil; 
}

.run_loopback(a) ⇒ Object



422
423
424
425
426
427
428
429
430
431
432
433
434
435
# File 'ext/init.c', line 422

static VALUE
nanomsg_run_loopback(VALUE self, VALUE a)
{
  struct device_op dop; 

  dop.sa = sock_get(a);
  dop.sb = -1;          // invalid socket, see documentation

  WITHOUT_GVL(nanomsg_run_device_no_gvl, &dop, RUBY_UBF_IO, 0);
  if (dop.err < 0)
    RAISE_SOCK_ERROR;

  return Qnil; 
}

.terminateObject



384
385
386
387
388
389
390
# File 'ext/init.c', line 384

static VALUE
nanomsg_terminate(VALUE self)
{
  nn_term(); 

  return Qnil; 
}