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
87beaaa0
Commit
87beaaa0
authored
Sep 28, 2010
by
Gonzalo Diethelm
Committed by
Martin Sustrik
Sep 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZMQ_TYPE socket option added
parent
6715f9b1
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
37 additions
and
0 deletions
+37
-0
.gitignore
.gitignore
+1
-0
zmq_getsockopt.txt
doc/zmq_getsockopt.txt
+13
-0
zmq.h
include/zmq.h
+1
-0
options.cpp
src/options.cpp
+10
-0
options.hpp
src/options.hpp
+3
-0
pair.cpp
src/pair.cpp
+1
-0
pub.cpp
src/pub.cpp
+1
-0
pull.cpp
src/pull.cpp
+1
-0
push.cpp
src/push.cpp
+1
-0
rep.cpp
src/rep.cpp
+1
-0
req.cpp
src/req.cpp
+1
-0
sub.cpp
src/sub.cpp
+1
-0
xrep.cpp
src/xrep.cpp
+1
-0
xreq.cpp
src/xreq.cpp
+1
-0
No files found.
.gitignore
View file @
87beaaa0
...
...
@@ -35,6 +35,7 @@ doc/*.7
doc/*.html
doc/*.xml
src/libzmq.pc
bin/
lib/
builds/msvc/*.suo
builds/msvc/*/*.user
...
...
doc/zmq_getsockopt.txt
View file @
87beaaa0
...
...
@@ -26,6 +26,19 @@ value stored in the buffer.
The following options can be retrieved with the _zmq_getsockopt()_ function:
ZMQ_TYPE: Retrieve socket type.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_TYPE option shall retrieve the socket type for the specified
'socket'. The socket type is specified at socket creation time and
cannot be modified afterwards.
[horizontal]
Option value type:: int
Option value unit:: N/A
Default value:: N/A
Applicable socket types:: all
ZMQ_RCVMORE: More message parts to follow
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_RCVMORE' option shall return a boolean value indicating if the
...
...
include/zmq.h
View file @
87beaaa0
...
...
@@ -179,6 +179,7 @@ ZMQ_EXPORT int zmq_term (void *context);
#define ZMQ_RCVMORE 13
#define ZMQ_FD 14
#define ZMQ_EVENTS 15
#define ZMQ_TYPE 16
/* Send/recv options. */
#define ZMQ_NOBLOCK 1
...
...
src/options.cpp
View file @
87beaaa0
...
...
@@ -33,6 +33,7 @@ zmq::options_t::options_t () :
use_multicast_loop
(
true
),
sndbuf
(
0
),
rcvbuf
(
0
),
type
(
-
1
),
requires_in
(
false
),
requires_out
(
false
),
immediate_connect
(
true
)
...
...
@@ -137,6 +138,15 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
{
switch
(
option_
)
{
case
ZMQ_TYPE
:
if
(
*
optvallen_
<
sizeof
(
int
))
{
errno
=
EINVAL
;
return
-
1
;
}
*
((
int
*
)
optval_
)
=
type
;
*
optvallen_
=
sizeof
(
int
);
return
0
;
case
ZMQ_HWM
:
if
(
*
optvallen_
<
sizeof
(
uint64_t
))
{
errno
=
EINVAL
;
...
...
src/options.hpp
View file @
87beaaa0
...
...
@@ -51,6 +51,9 @@ namespace zmq
uint64_t
sndbuf
;
uint64_t
rcvbuf
;
// Socket type.
int
type
;
// These options are never set by the user directly. Instead they are
// provided by the specific socket type.
bool
requires_in
;
...
...
src/pair.cpp
View file @
87beaaa0
...
...
@@ -31,6 +31,7 @@ zmq::pair_t::pair_t (class ctx_t *parent_, uint32_t slot_) :
outpipe_alive
(
false
),
terminating
(
false
)
{
options
.
type
=
ZMQ_PAIR
;
options
.
requires_in
=
true
;
options
.
requires_out
=
true
;
}
...
...
src/pub.cpp
View file @
87beaaa0
...
...
@@ -29,6 +29,7 @@ zmq::pub_t::pub_t (class ctx_t *parent_, uint32_t slot_) :
active
(
0
),
terminating
(
false
)
{
options
.
type
=
ZMQ_PUB
;
options
.
requires_in
=
false
;
options
.
requires_out
=
true
;
}
...
...
src/pull.cpp
View file @
87beaaa0
...
...
@@ -26,6 +26,7 @@ zmq::pull_t::pull_t (class ctx_t *parent_, uint32_t slot_) :
socket_base_t
(
parent_
,
slot_
),
fq
(
this
)
{
options
.
type
=
ZMQ_PULL
;
options
.
requires_in
=
true
;
options
.
requires_out
=
false
;
}
...
...
src/push.cpp
View file @
87beaaa0
...
...
@@ -27,6 +27,7 @@ zmq::push_t::push_t (class ctx_t *parent_, uint32_t slot_) :
socket_base_t
(
parent_
,
slot_
),
lb
(
this
)
{
options
.
type
=
ZMQ_PUSH
;
options
.
requires_in
=
false
;
options
.
requires_out
=
true
;
}
...
...
src/rep.cpp
View file @
87beaaa0
...
...
@@ -27,6 +27,7 @@ zmq::rep_t::rep_t (class ctx_t *parent_, uint32_t slot_) :
sending_reply
(
false
),
request_begins
(
true
)
{
options
.
type
=
ZMQ_REP
;
}
zmq
::
rep_t
::~
rep_t
()
...
...
src/req.cpp
View file @
87beaaa0
...
...
@@ -27,6 +27,7 @@ zmq::req_t::req_t (class ctx_t *parent_, uint32_t slot_) :
receiving_reply
(
false
),
message_begins
(
true
)
{
options
.
type
=
ZMQ_REQ
;
}
zmq
::
req_t
::~
req_t
()
...
...
src/sub.cpp
View file @
87beaaa0
...
...
@@ -30,6 +30,7 @@ zmq::sub_t::sub_t (class ctx_t *parent_, uint32_t slot_) :
has_message
(
false
),
more
(
false
)
{
options
.
type
=
ZMQ_SUB
;
options
.
requires_in
=
true
;
options
.
requires_out
=
false
;
zmq_msg_init
(
&
message
);
...
...
src/xrep.cpp
View file @
87beaaa0
...
...
@@ -32,6 +32,7 @@ zmq::xrep_t::xrep_t (class ctx_t *parent_, uint32_t slot_) :
more_out
(
false
),
terminating
(
false
)
{
options
.
type
=
ZMQ_XREP
;
options
.
requires_in
=
true
;
options
.
requires_out
=
true
;
...
...
src/xreq.cpp
View file @
87beaaa0
...
...
@@ -27,6 +27,7 @@ zmq::xreq_t::xreq_t (class ctx_t *parent_, uint32_t slot_) :
fq
(
this
),
lb
(
this
)
{
options
.
type
=
ZMQ_XREQ
;
options
.
requires_in
=
true
;
options
.
requires_out
=
true
;
}
...
...
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