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
2cd34da1
Commit
2cd34da1
authored
Aug 15, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: code duplication in session_base_t::start_connecting
Solution: extract common code
parent
799fae44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
29 deletions
+17
-29
session_base.cpp
src/session_base.cpp
+17
-29
No files found.
src/session_base.cpp
View file @
2cd34da1
...
...
@@ -560,46 +560,44 @@ void zmq::session_base_t::start_connecting (bool wait_)
zmq_assert
(
io_thread
);
// Create the connecter object.
own_t
*
connecter
=
NULL
;
if
(
_addr
->
protocol
==
protocol_name
::
tcp
)
{
if
(
!
options
.
socks_proxy_address
.
empty
())
{
address_t
*
proxy_address
=
new
(
std
::
nothrow
)
address_t
(
protocol_name
::
tcp
,
options
.
socks_proxy_address
,
this
->
get_ctx
());
alloc_assert
(
proxy_address
);
socks_connecter_t
*
connecter
=
new
(
std
::
nothrow
)
socks_connecter_t
(
io_thread
,
this
,
options
,
_addr
,
proxy_address
,
wait_
);
alloc_assert
(
connecter
);
launch_child
(
connecter
);
connecter
=
new
(
std
::
nothrow
)
socks_connecter_t
(
io_thread
,
this
,
options
,
_addr
,
proxy_address
,
wait_
);
}
else
{
tcp_connecter_t
*
connecter
=
new
(
std
::
nothrow
)
connecter
=
new
(
std
::
nothrow
)
tcp_connecter_t
(
io_thread
,
this
,
options
,
_addr
,
wait_
);
alloc_assert
(
connecter
);
launch_child
(
connecter
);
}
return
;
}
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \
&& !defined ZMQ_HAVE_VXWORKS
if
(
_addr
->
protocol
==
protocol_name
::
ipc
)
{
ipc_connecter_t
*
connecter
=
new
(
std
::
nothrow
)
else
if
(
_addr
->
protocol
==
protocol_name
::
ipc
)
{
connecter
=
new
(
std
::
nothrow
)
ipc_connecter_t
(
io_thread
,
this
,
options
,
_addr
,
wait_
);
alloc_assert
(
connecter
);
launch_child
(
connecter
);
return
;
}
#endif
#if defined ZMQ_HAVE_TIPC
if
(
_addr
->
protocol
==
protocol_name
::
tipc
)
{
tipc_connecter_t
*
connecter
=
new
(
std
::
nothrow
)
else
if
(
_addr
->
protocol
==
protocol_name
::
tipc
)
{
connecter
=
new
(
std
::
nothrow
)
tipc_connecter_t
(
io_thread
,
this
,
options
,
_addr
,
wait_
);
}
#endif
#if defined ZMQ_HAVE_VMCI
else
if
(
_addr
->
protocol
==
protocol_name
::
vmci
)
{
connecter
=
new
(
std
::
nothrow
)
vmci_connecter_t
(
io_thread
,
this
,
options
,
_addr
,
wait_
);
}
#endif
if
(
connecter
!=
NULL
)
{
alloc_assert
(
connecter
);
launch_child
(
connecter
);
return
;
}
#endif
if
(
_addr
->
protocol
==
protocol_name
::
udp
)
{
zmq_assert
(
options
.
type
==
ZMQ_DISH
||
options
.
type
==
ZMQ_RADIO
...
...
@@ -702,15 +700,5 @@ void zmq::session_base_t::start_connecting (bool wait_)
}
#endif // ZMQ_HAVE_NORM
#if defined ZMQ_HAVE_VMCI
if
(
_addr
->
protocol
==
protocol_name
::
vmci
)
{
vmci_connecter_t
*
connecter
=
new
(
std
::
nothrow
)
vmci_connecter_t
(
io_thread
,
this
,
options
,
_addr
,
wait_
);
alloc_assert
(
connecter
);
launch_child
(
connecter
);
return
;
}
#endif
zmq_assert
(
false
);
}
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