diff options
author | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-09-20 10:14:21 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-09-20 10:14:21 +0200 |
commit | 50a8b9ea0c4a819073b46449dee8fc839b837ae5 (patch) | |
tree | a1effc887ebb0e824959b114dd0ed67e788d0507 /bindings/ruby | |
parent | edecf75b611cf0e6b1c2658846cff013434edad4 (diff) |
'flags' parameter added to zmq_init
Diffstat (limited to 'bindings/ruby')
-rw-r--r-- | bindings/ruby/rbzmq.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bindings/ruby/rbzmq.cpp b/bindings/ruby/rbzmq.cpp index bf0d9bc..83bb2b6 100644 --- a/bindings/ruby/rbzmq.cpp +++ b/bindings/ruby/rbzmq.cpp @@ -38,10 +38,11 @@ static VALUE context_alloc (VALUE class_) } static VALUE context_initialize (VALUE self_, VALUE app_threads_, - VALUE io_threads_) + VALUE io_threads_, VALUE flags_) { assert (!DATA_PTR (self_)); - void *ctx = zmq_init (NUM2INT (app_threads_), NUM2INT (io_threads_)); + void *ctx = zmq_init (NUM2INT (app_threads_), NUM2INT (io_threads_), + NUM2INT (flags_)); if (!ctx) { rb_raise (rb_eRuntimeError, strerror (errno)); return Qnil; @@ -105,8 +106,8 @@ static VALUE socket_setsockopt (VALUE self_, VALUE option_, rc = zmq_setsockopt (DATA_PTR (self_), NUM2INT (option_), (void *) &optval, 4); } - break; + case ZMQ_IDENTITY: case ZMQ_SUBSCRIBE: case ZMQ_UNSUBSCRIBE: @@ -236,7 +237,7 @@ extern "C" void Init_librbzmq () VALUE context_type = rb_define_class ("Context", rb_cObject); rb_define_alloc_func (context_type, context_alloc); rb_define_method (context_type, "initialize", - (VALUE(*)(...)) context_initialize, 2); + (VALUE(*)(...)) context_initialize, 3); VALUE socket_type = rb_define_class ("Socket", rb_cObject); rb_define_alloc_func (socket_type, socket_alloc); @@ -274,4 +275,6 @@ extern "C" void Init_librbzmq () rb_define_global_const ("PUB", INT2NUM (ZMQ_PUB)); rb_define_global_const ("REQ", INT2NUM (ZMQ_REQ)); rb_define_global_const ("REP", INT2NUM (ZMQ_REP)); + + rb_define_global_const ("POLL", INT2NUM (ZMQ_POLL)); } |