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
ebd22ecf
Commit
ebd22ecf
authored
Mar 12, 2020
by
JaeSang Yoo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: literals protocol names still remains
Solution: replace into named constants
parent
0c7ee438
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
16 deletions
+24
-16
address.hpp
src/address.hpp
+3
-0
session_base.cpp
src/session_base.cpp
+8
-6
socket_base.cpp
src/socket_base.cpp
+11
-8
zmq.cpp
src/zmq.cpp
+2
-2
No files found.
src/address.hpp
View file @
ebd22ecf
...
...
@@ -62,6 +62,9 @@ namespace protocol_name
static
const
char
inproc
[]
=
"inproc"
;
static
const
char
tcp
[]
=
"tcp"
;
static
const
char
udp
[]
=
"udp"
;
static
const
char
pgm
[]
=
"pgm"
;
static
const
char
epgm
[]
=
"epgm"
;
static
const
char
norm
[]
=
"norm"
;
#ifdef ZMQ_HAVE_WS
static
const
char
ws
[]
=
"ws"
;
#endif
...
...
src/session_base.cpp
View file @
ebd22ecf
...
...
@@ -534,8 +534,10 @@ void zmq::session_base_t::reconnect ()
{
// For delayed connect situations, terminate the pipe
// and reestablish later on
if
(
_pipe
&&
options
.
immediate
==
1
&&
_addr
->
protocol
!=
"pgm"
&&
_addr
->
protocol
!=
"epgm"
&&
_addr
->
protocol
!=
"norm"
if
(
_pipe
&&
options
.
immediate
==
1
&&
_addr
->
protocol
!=
protocol_name
::
pgm
&&
_addr
->
protocol
!=
protocol_name
::
epgm
&&
_addr
->
protocol
!=
protocol_name
::
norm
&&
_addr
->
protocol
!=
protocol_name
::
udp
)
{
_pipe
->
hiccup
();
_pipe
->
terminate
(
false
);
...
...
@@ -604,13 +606,13 @@ zmq::session_base_t::start_connecting_entry_t
start_connecting_entry_t
(
protocol_name
::
udp
,
&
zmq
::
session_base_t
::
start_connecting_udp
),
#if defined ZMQ_HAVE_OPENPGM
start_connecting_entry_t
(
"pgm"
,
start_connecting_entry_t
(
protocol_name
::
pgm
,
&
zmq
::
session_base_t
::
start_connecting_pgm
),
start_connecting_entry_t
(
"epgm"
,
start_connecting_entry_t
(
protocol_name
::
epgm
,
&
zmq
::
session_base_t
::
start_connecting_pgm
),
#endif
#if defined ZMQ_HAVE_NORM
start_connecting_entry_t
(
"norm"
,
start_connecting_entry_t
(
protocol_name
::
norm
,
&
zmq
::
session_base_t
::
start_connecting_norm
),
#endif
};
...
...
@@ -724,7 +726,7 @@ void zmq::session_base_t::start_connecting_pgm (io_thread_t *io_thread_)
||
options
.
type
==
ZMQ_SUB
||
options
.
type
==
ZMQ_XSUB
);
// For EPGM transport with UDP encapsulation of PGM is used.
bool
const
udp_encapsulation
=
_addr
->
protocol
==
"epgm"
;
bool
const
udp_encapsulation
=
_addr
->
protocol
==
protocol_name
::
epgm
;
// At this point we'll create message pipes to the session straight
// away. There's no point in delaying it as no concept of 'connect'
...
...
src/socket_base.cpp
View file @
ebd22ecf
...
...
@@ -347,15 +347,15 @@ int zmq::socket_base_t::check_protocol (const std::string &protocol_) const
#endif
#if defined ZMQ_HAVE_OPENPGM
// pgm/epgm transports only available if 0MQ is compiled with OpenPGM.
&&
protocol_
!=
"pgm"
&&
protocol_
!=
"epgm"
&&
protocol_
!=
protocol_name
::
pgm
&&
protocol_
!=
protocol_name
::
epgm
#endif
#if defined ZMQ_HAVE_TIPC
// TIPC transport is only available on Linux.
&&
protocol_
!=
protocol_name
::
tipc
#endif
#if defined ZMQ_HAVE_NORM
&&
protocol_
!=
"norm"
&&
protocol_
!=
protocol_name
::
norm
#endif
#if defined ZMQ_HAVE_VMCI
&&
protocol_
!=
protocol_name
::
vmci
...
...
@@ -369,7 +369,8 @@ int zmq::socket_base_t::check_protocol (const std::string &protocol_) const
// Specifically, multicast protocols can't be combined with
// bi-directional messaging patterns (socket types).
#if defined ZMQ_HAVE_OPENPGM || defined ZMQ_HAVE_NORM
if
((
protocol_
==
"pgm"
||
protocol_
==
"epgm"
||
protocol_
==
"norm"
)
if
((
protocol_
==
protocol_name
::
pgm
||
protocol_
==
protocol_name
::
epgm
||
protocol_
==
protocol_name
::
norm
)
&&
options
.
type
!=
ZMQ_PUB
&&
options
.
type
!=
ZMQ_SUB
&&
options
.
type
!=
ZMQ_XPUB
&&
options
.
type
!=
ZMQ_XSUB
)
{
errno
=
ENOCOMPATPROTO
;
...
...
@@ -546,7 +547,8 @@ int zmq::socket_base_t::bind (const char *endpoint_uri_)
return
rc
;
}
if
(
protocol
==
"pgm"
||
protocol
==
"epgm"
||
protocol
==
"norm"
)
{
if
(
protocol
==
protocol_name
::
pgm
||
protocol
==
protocol_name
::
epgm
||
protocol
==
protocol_name
::
norm
)
{
// For convenience's sake, bind can be used interchangeable with
// connect for PGM, EPGM, NORM transports.
rc
=
connect
(
endpoint_uri_
);
...
...
@@ -968,7 +970,7 @@ int zmq::socket_base_t::connect_internal (const char *endpoint_uri_)
// TBD - Should we check address for ZMQ_HAVE_NORM???
#ifdef ZMQ_HAVE_OPENPGM
if
(
protocol
==
"pgm"
||
protocol
==
"epgm"
)
{
if
(
protocol
==
protocol_name
::
pgm
||
protocol
==
protocol_name
::
epgm
)
{
struct
pgm_addrinfo_t
*
res
=
NULL
;
uint16_t
port_number
=
0
;
int
rc
=
...
...
@@ -1021,8 +1023,9 @@ int zmq::socket_base_t::connect_internal (const char *endpoint_uri_)
// PGM does not support subscription forwarding; ask for all data to be
// sent to this pipe. (same for NORM, currently?)
const
bool
subscribe_to_all
=
protocol
==
"pgm"
||
protocol
==
"epgm"
||
protocol
==
"norm"
const
bool
subscribe_to_all
=
protocol
==
protocol_name
::
pgm
||
protocol
==
protocol_name
::
epgm
||
protocol
==
protocol_name
::
norm
||
protocol
==
protocol_name
::
udp
;
pipe_t
*
newpipe
=
NULL
;
...
...
src/zmq.cpp
View file @
ebd22ecf
...
...
@@ -1477,7 +1477,7 @@ int zmq_has (const char *capability_)
return
true
;
#endif
#if defined(ZMQ_HAVE_OPENPGM)
if
(
strcmp
(
capability_
,
"pgm"
)
==
0
)
if
(
strcmp
(
capability_
,
zmq
::
protocol_name
::
pgm
)
==
0
)
return
true
;
#endif
#if defined(ZMQ_HAVE_TIPC)
...
...
@@ -1485,7 +1485,7 @@ int zmq_has (const char *capability_)
return
true
;
#endif
#if defined(ZMQ_HAVE_NORM)
if
(
strcmp
(
capability_
,
"norm"
)
==
0
)
if
(
strcmp
(
capability_
,
zmq
::
protocol_name
::
norm
)
==
0
)
return
true
;
#endif
#if defined(ZMQ_HAVE_CURVE)
...
...
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