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
72b15a6d
Commit
72b15a6d
authored
Oct 16, 2010
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementation of zmq_strerror moved from zmq.cpp to err.cpp
Signed-off-by:
Martin Sustrik
<
sustrik@250bpm.com
>
parent
61d38fbe
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
39 deletions
+47
-39
err.cpp
src/err.cpp
+41
-0
err.hpp
src/err.hpp
+5
-2
zmq.cpp
src/zmq.cpp
+1
-37
No files found.
src/err.cpp
View file @
72b15a6d
...
...
@@ -22,6 +22,47 @@
#include "err.hpp"
#include "platform.hpp"
const
char
*
zmq
::
errno_to_string
(
int
errno_
)
{
switch
(
errno_
)
{
#if defined ZMQ_HAVE_WINDOWS
case
ENOTSUP
:
return
"Not supported"
;
case
EPROTONOSUPPORT
:
return
"Protocol not supported"
;
case
ENOBUFS
:
return
"No buffer space available"
;
case
ENETDOWN
:
return
"Network is down"
;
case
EADDRINUSE
:
return
"Address in use"
;
case
EADDRNOTAVAIL
:
return
"Address not available"
;
case
ECONNREFUSED
:
return
"Connection refused"
;
case
EINPROGRESS
:
return
"Operation in progress"
;
#endif
case
EFSM
:
return
"Operation cannot be accomplished in current state"
;
case
ENOCOMPATPROTO
:
return
"The protocol is not compatible with the socket type"
;
case
ETERM
:
return
"Context was terminated"
;
case
EMTHREAD
:
return
"No thread available"
;
default
:
#if defined _MSC_VER
#pragma warning (push)
#pragma warning (disable:4996)
#endif
return
strerror
(
errno_
);
#if defined _MSC_VER
#pragma warning (pop)
#endif
}
}
#ifdef ZMQ_HAVE_WINDOWS
const
char
*
zmq
::
wsa_error
()
...
...
src/err.hpp
View file @
72b15a6d
...
...
@@ -35,15 +35,18 @@
#include <netdb.h>
#endif
namespace
zmq
{
const
char
*
errno_to_string
(
int
errno_
);
}
#ifdef ZMQ_HAVE_WINDOWS
namespace
zmq
{
const
char
*
wsa_error
();
void
win_error
(
char
*
buffer_
,
size_t
buffer_size_
);
void
wsa_error_to_errno
();
}
// Provides convenient way to check WSA-style errors on Windows.
...
...
src/zmq.cpp
View file @
72b15a6d
...
...
@@ -63,43 +63,7 @@ void zmq_version (int *major_, int *minor_, int *patch_)
const
char
*
zmq_strerror
(
int
errnum_
)
{
switch
(
errnum_
)
{
#if defined ZMQ_HAVE_WINDOWS
case
ENOTSUP
:
return
"Not supported"
;
case
EPROTONOSUPPORT
:
return
"Protocol not supported"
;
case
ENOBUFS
:
return
"No buffer space available"
;
case
ENETDOWN
:
return
"Network is down"
;
case
EADDRINUSE
:
return
"Address in use"
;
case
EADDRNOTAVAIL
:
return
"Address not available"
;
case
ECONNREFUSED
:
return
"Connection refused"
;
case
EINPROGRESS
:
return
"Operation in progress"
;
#endif
case
EFSM
:
return
"Operation cannot be accomplished in current state"
;
case
ENOCOMPATPROTO
:
return
"The protocol is not compatible with the socket type"
;
case
ETERM
:
return
"Context was terminated"
;
case
EMTHREAD
:
return
"No thread available"
;
default:
#if defined _MSC_VER
#pragma warning (push)
#pragma warning (disable:4996)
#endif
return
strerror
(
errnum_
);
#if defined _MSC_VER
#pragma warning (pop)
#endif
}
return
zmq
::
errno_to_string
(
errnum_
);
}
int
zmq_msg_init
(
zmq_msg_t
*
msg_
)
...
...
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