summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/err.cpp2
-rw-r--r--src/socket_base.cpp10
2 files changed, 2 insertions, 10 deletions
diff --git a/src/err.cpp b/src/err.cpp
index f05cf06..f9549ff 100644
--- a/src/err.cpp
+++ b/src/err.cpp
@@ -49,8 +49,6 @@ const char *xs::errno_to_string (int errno_)
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)
diff --git a/src/socket_base.cpp b/src/socket_base.cpp
index fbb3b5e..5b1752e 100644
--- a/src/socket_base.cpp
+++ b/src/socket_base.cpp
@@ -326,10 +326,7 @@ int xs::socket_base_t::bind (const char *addr_)
// Remaining trasnports require to be run in an I/O thread, so at this
// point we'll choose one.
io_thread_t *thread = choose_io_thread (options.affinity);
- if (!thread) {
- errno = EMTHREAD;
- return -1;
- }
+ xs_assert (thread);
if (protocol == "tcp") {
tcp_listener_t *listener = new (std::nothrow) tcp_listener_t (
@@ -437,10 +434,7 @@ int xs::socket_base_t::connect (const char *addr_)
// Choose the I/O thread to run the session in.
io_thread_t *thread = choose_io_thread (options.affinity);
- if (!thread) {
- errno = EMTHREAD;
- return -1;
- }
+ xs_assert (thread);
// Create session.
session_base_t *session = session_base_t::create (thread, true, this,