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
799fae44
Commit
799fae44
authored
Aug 15, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: magic literal used for inproc
Solution: define and use named constant
parent
daadb65a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
address.hpp
src/address.hpp
+1
-0
socket_base.cpp
src/socket_base.cpp
+5
-5
No files found.
src/address.hpp
View file @
799fae44
...
...
@@ -49,6 +49,7 @@ class vmci_address_t;
namespace
protocol_name
{
static
const
char
inproc
[]
=
"inproc"
;
static
const
char
tcp
[]
=
"tcp"
;
static
const
char
udp
[]
=
"udp"
;
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \
...
...
src/socket_base.cpp
View file @
799fae44
...
...
@@ -326,7 +326,7 @@ int zmq::socket_base_t::parse_uri (const char *uri_,
int
zmq
::
socket_base_t
::
check_protocol
(
const
std
::
string
&
protocol_
)
const
{
// First check out whether the protocol is something we are aware of.
if
(
protocol_
!=
"inproc"
if
(
protocol_
!=
protocol_name
::
inproc
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \
&& !defined ZMQ_HAVE_VXWORKS
&&
protocol_
!=
protocol_name
::
ipc
...
...
@@ -522,7 +522,7 @@ int zmq::socket_base_t::bind (const char *endpoint_uri_)
return
-
1
;
}
if
(
protocol
==
"inproc"
)
{
if
(
protocol
==
protocol_name
::
inproc
)
{
const
endpoint_t
endpoint
=
{
this
,
options
};
rc
=
register_endpoint
(
endpoint_uri_
,
endpoint
);
if
(
rc
==
0
)
{
...
...
@@ -714,7 +714,7 @@ int zmq::socket_base_t::connect (const char *endpoint_uri_)
return
-
1
;
}
if
(
protocol
==
"inproc"
)
{
if
(
protocol
==
protocol_name
::
inproc
)
{
// TODO: inproc connect is specific with respect to creating pipes
// as there's no 'reconnect' functionality implemented. Once that
// is in place we should follow generic pipe creation algorithm.
...
...
@@ -1045,7 +1045,7 @@ int zmq::socket_base_t::term_endpoint (const char *endpoint_uri_)
const
std
::
string
endpoint_uri_str
=
std
::
string
(
endpoint_uri_
);
// Disconnect an inproc socket
if
(
uri_protocol
==
"inproc"
)
{
if
(
uri_protocol
==
protocol_name
::
inproc
)
{
return
unregister_endpoint
(
endpoint_uri_str
,
this
)
==
0
?
0
:
_inprocs
.
erase_pipes
(
endpoint_uri_str
);
...
...
@@ -1578,7 +1578,7 @@ int zmq::socket_base_t::monitor (const char *endpoint_, int events_)
return
-
1
;
// Event notification only supported over inproc://
if
(
protocol
!=
"inproc"
)
{
if
(
protocol
!=
protocol_name
::
inproc
)
{
errno
=
EPROTONOSUPPORT
;
return
-
1
;
}
...
...
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