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
b3ca7fd4
Commit
b3ca7fd4
authored
Aug 18, 2013
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #627 from ianbarber/master
Attempt to fix disconnect not respecting linger
parents
1011e8ad
cb35fd7b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
socket_base.cpp
src/socket_base.cpp
+13
-7
socket_base.hpp
src/socket_base.hpp
+3
-2
No files found.
src/socket_base.cpp
View file @
b3ca7fd4
...
...
@@ -376,7 +376,7 @@ int zmq::socket_base_t::bind (const char *addr_)
// Save last endpoint URI
listener
->
get_address
(
last_endpoint
);
add_endpoint
(
addr_
,
(
own_t
*
)
listener
);
add_endpoint
(
addr_
,
(
own_t
*
)
listener
,
NULL
);
return
0
;
}
...
...
@@ -395,7 +395,7 @@ int zmq::socket_base_t::bind (const char *addr_)
// Save last endpoint URI
listener
->
get_address
(
last_endpoint
);
add_endpoint
(
addr_
,
(
own_t
*
)
listener
);
add_endpoint
(
addr_
,
(
own_t
*
)
listener
,
NULL
);
return
0
;
}
#endif
...
...
@@ -548,6 +548,7 @@ int zmq::socket_base_t::connect (const char *addr_)
// PGM does not support subscription forwarding; ask for all data to be
// sent to this pipe.
bool
icanhasall
=
protocol
==
"pgm"
||
protocol
==
"epgm"
;
pipe_t
*
newpipe
=
NULL
;
if
(
options
.
immediate
!=
1
||
icanhasall
)
{
// Create a bi-directional pipe.
...
...
@@ -560,6 +561,7 @@ int zmq::socket_base_t::connect (const char *addr_)
// Attach local end of the pipe to the socket object.
attach_pipe
(
new_pipes
[
0
],
icanhasall
);
newpipe
=
new_pipes
[
0
];
// Attach remote end of the pipe to the session object later on.
session
->
attach_pipe
(
new_pipes
[
1
]);
...
...
@@ -568,15 +570,15 @@ int zmq::socket_base_t::connect (const char *addr_)
// Save last endpoint URI
paddr
->
to_string
(
last_endpoint
);
add_endpoint
(
addr_
,
(
own_t
*
)
session
);
add_endpoint
(
addr_
,
(
own_t
*
)
session
,
newpipe
);
return
0
;
}
void
zmq
::
socket_base_t
::
add_endpoint
(
const
char
*
addr_
,
own_t
*
endpoint_
)
void
zmq
::
socket_base_t
::
add_endpoint
(
const
char
*
addr_
,
own_t
*
endpoint_
,
pipe_t
*
pipe
)
{
// Activate the session. Make it a child of this socket.
launch_child
(
endpoint_
);
endpoints
.
insert
(
endpoints_t
::
value_type
(
std
::
string
(
addr_
),
endpoint_
));
endpoints
.
insert
(
endpoints_t
::
value_type
(
std
::
string
(
addr_
),
endpoint_
pipe_t
(
endpoint_
,
pipe
)
));
}
int
zmq
::
socket_base_t
::
term_endpoint
(
const
char
*
addr_
)
...
...
@@ -631,8 +633,12 @@ int zmq::socket_base_t::term_endpoint (const char *addr_)
return
-
1
;
}
for
(
endpoints_t
::
iterator
it
=
range
.
first
;
it
!=
range
.
second
;
++
it
)
term_child
(
it
->
second
);
for
(
endpoints_t
::
iterator
it
=
range
.
first
;
it
!=
range
.
second
;
++
it
)
{
// If we have an associated pipe, terminate it.
if
(
it
->
second
.
second
!=
NULL
)
it
->
second
.
second
->
terminate
(
false
);
term_child
(
it
->
second
.
first
);
}
endpoints
.
erase
(
range
.
first
,
range
.
second
);
return
0
;
}
...
...
src/socket_base.hpp
View file @
b3ca7fd4
...
...
@@ -158,10 +158,11 @@ namespace zmq
private
:
// Creates new endpoint ID and adds the endpoint to the map.
void
add_endpoint
(
const
char
*
addr_
,
own_t
*
endpoint_
);
void
add_endpoint
(
const
char
*
addr_
,
own_t
*
endpoint_
,
pipe_t
*
pipe
);
// Map of open endpoints.
typedef
std
::
multimap
<
std
::
string
,
own_t
*>
endpoints_t
;
typedef
std
::
pair
<
own_t
*
,
pipe_t
*>
endpoint_pipe_t
;
typedef
std
::
multimap
<
std
::
string
,
endpoint_pipe_t
>
endpoints_t
;
endpoints_t
endpoints
;
// Map of open inproc endpoints.
...
...
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