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
47dbd4aa
Commit
47dbd4aa
authored
May 03, 2012
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #334 from ianbarber/master
Async connect error handling
parents
f497aae8
1075005b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
ipc_connecter.cpp
src/ipc_connecter.cpp
+7
-0
tcp_connecter.cpp
src/tcp_connecter.cpp
+6
-5
No files found.
src/ipc_connecter.cpp
View file @
47dbd4aa
...
...
@@ -186,6 +186,13 @@ int zmq::ipc_connecter_t::open ()
// Connect was successfull immediately.
if
(
rc
==
0
)
return
0
;
// Translate other error codes indicating asynchronous connect has been
// launched to a uniform EINPROGRESS.
if
(
rc
==
-
1
&&
errno
==
EINTR
)
{
errno
=
EINPROGRESS
;
return
-
1
;
}
// Forward the error.
return
-
1
;
...
...
src/tcp_connecter.cpp
View file @
47dbd4aa
...
...
@@ -140,7 +140,7 @@ void zmq::tcp_connecter_t::start_connecting ()
}
// Connection establishment may be delayed. Poll for its completion.
else
if
(
rc
==
-
1
&&
errno
==
E
AGAIN
)
{
else
if
(
rc
==
-
1
&&
errno
==
E
INPROGRESS
)
{
handle
=
add_fd
(
s
);
handle_valid
=
true
;
set_pollout
(
handle
);
...
...
@@ -211,17 +211,18 @@ int zmq::tcp_connecter_t::open ()
if
(
rc
==
0
)
return
0
;
// Asynchronous connect was launched.
// Translate other error codes indicating asynchronous connect has been
// launched to a uniform EINPROGRESS.
#ifdef ZMQ_HAVE_WINDOWS
if
(
rc
==
SOCKET_ERROR
&&
(
WSAGetLastError
()
==
WSAEINPROGRESS
||
WSAGetLastError
()
==
WSAEWOULDBLOCK
))
{
errno
=
E
AGAIN
;
errno
=
E
INPROGRESS
;
return
-
1
;
}
wsa_error_to_errno
();
#else
if
(
rc
==
-
1
&&
errno
==
EIN
PROGRESS
)
{
errno
=
E
AGAIN
;
if
(
rc
==
-
1
&&
errno
==
EIN
TR
)
{
errno
=
E
INPROGRESS
;
return
-
1
;
}
#endif
...
...
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