From 0fa65dad08bcb6b7af3a3b24cec69fde78818f54 Mon Sep 17 00:00:00 2001 From: Aleksey Yeschenko Date: Fri, 4 Jun 2010 23:31:36 +0300 Subject: [PATCH] zmq:init(io_threads) --- API.md | 3 +-- examples/client.lua | 2 +- examples/client_multipart.lua | 2 +- examples/publiser.lua | 2 +- examples/server.lua | 2 +- examples/server_multipart.lua | 2 +- examples/subscriber.lua | 2 +- perf/local_lat.lua | 2 +- perf/local_thr.lua | 2 +- perf/remote_lat.lua | 2 +- perf/remote_thr.lua | 2 +- zmq.c | 8 ++------ 12 files changed, 13 insertions(+), 18 deletions(-) diff --git a/API.md b/API.md index 6dacbca..b634257 100644 --- a/API.md +++ b/API.md @@ -14,8 +14,7 @@ zmq.version() Initialises ØMQ context. See [zmq_init(3)](http://api.zeromq.org/zmq_init.html). -zmq.init(app_threads, io_threads) -zmq.init(app_threads, io_threads, flags) +zmq.init(io_threads) ## term diff --git a/examples/client.lua b/examples/client.lua index ecc1c6e..682a549 100644 --- a/examples/client.lua +++ b/examples/client.lua @@ -20,7 +20,7 @@ require("zmq") -local ctx = zmq.init(1, 1) +local ctx = zmq.init(1) local s = ctx:socket(zmq.REQ) s:connect("tcp://localhost:5555") diff --git a/examples/client_multipart.lua b/examples/client_multipart.lua index c830e57..e82ca26 100644 --- a/examples/client_multipart.lua +++ b/examples/client_multipart.lua @@ -20,7 +20,7 @@ require("zmq") -local ctx = zmq.init(1, 1) +local ctx = zmq.init(1) local s = ctx:socket(zmq.REQ) s:connect("tcp://localhost:5555") diff --git a/examples/publiser.lua b/examples/publiser.lua index fe93595..12e240e 100644 --- a/examples/publiser.lua +++ b/examples/publiser.lua @@ -20,7 +20,7 @@ require("zmq") -local ctx = zmq.init(1, 1, 0) +local ctx = zmq.init(1) local s = ctx:socket(zmq.PUB) s:bind("tcp://lo:5555") diff --git a/examples/server.lua b/examples/server.lua index c1a0a49..57bb278 100644 --- a/examples/server.lua +++ b/examples/server.lua @@ -20,7 +20,7 @@ require("zmq") -local ctx = zmq.init(1, 1) +local ctx = zmq.init(1) local s = ctx:socket(zmq.REP) s:bind("tcp://lo:5555") diff --git a/examples/server_multipart.lua b/examples/server_multipart.lua index 974e83d..663c3f7 100644 --- a/examples/server_multipart.lua +++ b/examples/server_multipart.lua @@ -20,7 +20,7 @@ require("zmq") -local ctx = zmq.init(1, 1) +local ctx = zmq.init(1) local s = ctx:socket(zmq.REP) s:bind("tcp://lo:5555") diff --git a/examples/subscriber.lua b/examples/subscriber.lua index bec04e9..370b7dc 100644 --- a/examples/subscriber.lua +++ b/examples/subscriber.lua @@ -20,7 +20,7 @@ require("zmq") -local ctx = zmq.init(1, 1, 0) +local ctx = zmq.init(1) local s = ctx:socket(zmq.SUB) s:setopt(zmq.SUBSCRIBE, "") s:connect("tcp://localhost:5555") diff --git a/perf/local_lat.lua b/perf/local_lat.lua index 9294aaa..1df5b12 100644 --- a/perf/local_lat.lua +++ b/perf/local_lat.lua @@ -29,7 +29,7 @@ local bind_to = arg[1] local message_size = tonumber(arg[2]) local roundtrip_count = tonumber(arg[3]) -local ctx = zmq.init(1, 1) +local ctx = zmq.init(1) local s = ctx:socket(zmq.REP) s:bind(bind_to) diff --git a/perf/local_thr.lua b/perf/local_thr.lua index 5f4363f..329a16d 100644 --- a/perf/local_thr.lua +++ b/perf/local_thr.lua @@ -29,7 +29,7 @@ local bind_to = arg[1] local message_size = tonumber(arg[2]) local message_count = tonumber(arg[3]) -local ctx = zmq.init(1, 1) +local ctx = zmq.init(1) local s = ctx:socket(zmq.SUB) s:setopt(zmq.SUBSCRIBE, ""); s:bind(bind_to) diff --git a/perf/remote_lat.lua b/perf/remote_lat.lua index 1d5803c..8f36f9d 100644 --- a/perf/remote_lat.lua +++ b/perf/remote_lat.lua @@ -29,7 +29,7 @@ local connect_to = arg[1] local message_size = tonumber(arg[2]) local roundtrip_count = tonumber(arg[3]) -local ctx = zmq.init(1, 1) +local ctx = zmq.init(1) local s = ctx:socket(zmq.REQ) s:connect(connect_to) diff --git a/perf/remote_thr.lua b/perf/remote_thr.lua index 9333944..2824cd8 100644 --- a/perf/remote_thr.lua +++ b/perf/remote_thr.lua @@ -29,7 +29,7 @@ local connect_to = arg[1] local message_size = tonumber(arg[2]) local message_count = tonumber(arg[3]) -local ctx = zmq.init(1, 1) +local ctx = zmq.init(1) local s = ctx:socket(zmq.PUB) s:connect(connect_to) diff --git a/zmq.c b/zmq.c index 1343feb..8050372 100644 --- a/zmq.c +++ b/zmq.c @@ -60,13 +60,9 @@ static int Lzmq_version(lua_State *L) static int Lzmq_init(lua_State *L) { - int app_threads = luaL_checkint(L, 1); - int io_threads = luaL_checkint(L, 2); - int flags = luaL_optint(L, 3, 0); - + int io_threads = luaL_checkint(L, 1); zmq_ptr *ctx = lua_newuserdata(L, sizeof(zmq_ptr)); - - ctx->ptr = zmq_init(app_threads, io_threads, flags); + ctx->ptr = zmq_init(io_threads); if (!ctx->ptr) { return luaL_error(L, zmq_strerror(zmq_errno()));