Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
568cc1ad
Commit
568cc1ad
authored
Nov 07, 2013
by
Richard Newton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get maximum number of sockets it can handle from poller_t
parent
97cfa64d
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
45 additions
and
2 deletions
+45
-2
ctx.cpp
src/ctx.cpp
+10
-2
devpoll.cpp
src/devpoll.cpp
+5
-0
devpoll.hpp
src/devpoll.hpp
+2
-0
epoll.cpp
src/epoll.cpp
+5
-0
epoll.hpp
src/epoll.hpp
+2
-0
kqueue.cpp
src/kqueue.cpp
+5
-0
kqueue.hpp
src/kqueue.hpp
+2
-0
poll.cpp
src/poll.cpp
+5
-0
poll.hpp
src/poll.hpp
+2
-0
select.cpp
src/select.cpp
+5
-0
select.hpp
src/select.hpp
+2
-0
No files found.
src/ctx.cpp
View file @
568cc1ad
...
...
@@ -38,6 +38,14 @@
#define ZMQ_CTX_TAG_VALUE_GOOD 0xabadcafe
#define ZMQ_CTX_TAG_VALUE_BAD 0xdeadbeef
int
clipped_maxsocket
(
int
max_requested
)
{
if
(
max_requested
>=
zmq
::
poller_t
::
max_fds
()
&&
zmq
::
poller_t
::
max_fds
()
!=
-
1
)
max_requested
=
zmq
::
poller_t
::
max_fds
()
-
1
;
// -1 because we need room for the repear mailbox.
return
max_requested
;
}
zmq
::
ctx_t
::
ctx_t
()
:
tag
(
ZMQ_CTX_TAG_VALUE_GOOD
),
starting
(
true
),
...
...
@@ -45,7 +53,7 @@ zmq::ctx_t::ctx_t () :
reaper
(
NULL
),
slot_count
(
0
),
slots
(
NULL
),
max_sockets
(
ZMQ_MAX_SOCKETS_DFLT
),
max_sockets
(
clipped_maxsocket
(
ZMQ_MAX_SOCKETS_DFLT
)
),
io_thread_count
(
ZMQ_IO_THREADS_DFLT
),
ipv6
(
false
)
{
...
...
@@ -161,7 +169,7 @@ int zmq::ctx_t::shutdown ()
int
zmq
::
ctx_t
::
set
(
int
option_
,
int
optval_
)
{
int
rc
=
0
;
if
(
option_
==
ZMQ_MAX_SOCKETS
&&
optval_
>=
1
)
{
if
(
option_
==
ZMQ_MAX_SOCKETS
&&
optval_
>=
1
&&
optval_
==
clipped_maxsocket
(
optval_
)
)
{
opt_sync
.
lock
();
max_sockets
=
optval_
;
opt_sync
.
unlock
();
...
...
src/devpoll.cpp
View file @
568cc1ad
...
...
@@ -133,6 +133,11 @@ void zmq::devpoll_t::stop ()
stopping
=
true
;
}
int
zmq
::
devpoll_t
::
max_fds
()
{
return
-
1
;
}
void
zmq
::
devpoll_t
::
loop
()
{
while
(
!
stopping
)
{
...
...
src/devpoll.hpp
View file @
568cc1ad
...
...
@@ -56,6 +56,8 @@ namespace zmq
void
start
();
void
stop
();
static
int
max_fds
();
private
:
// Main worker thread routine.
...
...
src/epoll.cpp
View file @
568cc1ad
...
...
@@ -126,6 +126,11 @@ void zmq::epoll_t::stop ()
stopping
=
true
;
}
int
zmq
::
epoll_t
::
max_fds
()
{
return
-
1
;
}
void
zmq
::
epoll_t
::
loop
()
{
epoll_event
ev_buf
[
max_io_events
];
...
...
src/epoll.hpp
View file @
568cc1ad
...
...
@@ -58,6 +58,8 @@ namespace zmq
void
start
();
void
stop
();
static
int
max_fds
();
private
:
// Main worker thread routine.
...
...
src/kqueue.cpp
View file @
568cc1ad
...
...
@@ -152,6 +152,11 @@ void zmq::kqueue_t::stop ()
stopping
=
true
;
}
int
zmq
::
kqueue_t
::
max_fds
()
{
return
-
1
;
}
void
zmq
::
kqueue_t
::
loop
()
{
while
(
!
stopping
)
{
...
...
src/kqueue.hpp
View file @
568cc1ad
...
...
@@ -58,6 +58,8 @@ namespace zmq
void
start
();
void
stop
();
static
int
max_fds
();
private
:
// Main worker thread routine.
...
...
src/poll.cpp
View file @
568cc1ad
...
...
@@ -114,6 +114,11 @@ void zmq::poll_t::stop ()
stopping
=
true
;
}
int
zmq
::
poll_t
::
max_fds
()
{
return
-
1
;
}
void
zmq
::
poll_t
::
loop
()
{
while
(
!
stopping
)
{
...
...
src/poll.hpp
View file @
568cc1ad
...
...
@@ -59,6 +59,8 @@ namespace zmq
void
start
();
void
stop
();
static
int
max_fds
();
private
:
// Main worker thread routine.
...
...
src/select.cpp
View file @
568cc1ad
...
...
@@ -144,6 +144,11 @@ void zmq::select_t::stop ()
stopping
=
true
;
}
int
zmq
::
select_t
::
max_fds
()
{
return
FD_SETSIZE
;
}
void
zmq
::
select_t
::
loop
()
{
while
(
!
stopping
)
{
...
...
src/select.hpp
View file @
568cc1ad
...
...
@@ -69,6 +69,8 @@ namespace zmq
void
start
();
void
stop
();
static
int
max_fds
();
private
:
// Main worker thread routine.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment