summaryrefslogtreecommitdiff
path: root/src/ctx.cpp
diff options
context:
space:
mode:
authorPieter Hintjens <ph@imatix.com>2011-02-12 18:36:21 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-02-12 18:36:21 +0100
commit14a0e147b2b89fc7fed92c7d9c806b6c53380400 (patch)
tree159cdaab82958a03a706e72846b3225f9747030e /src/ctx.cpp
parente94790006ea6f4c64cc1df1c193aa1cf89a75100 (diff)
Fixed win32 issue with WSAStartup
- ctx constructor was calling mailbox_t constructor implicitly - moved WSAStartup and WSACleanup to be outside constructor/destructor Signed-off-by: Pieter Hintjens <ph@imatix.com>
Diffstat (limited to 'src/ctx.cpp')
-rw-r--r--src/ctx.cpp17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/ctx.cpp b/src/ctx.cpp
index 10c91c9..024e813 100644
--- a/src/ctx.cpp
+++ b/src/ctx.cpp
@@ -39,17 +39,6 @@ zmq::ctx_t::ctx_t (uint32_t io_threads_) :
{
int rc;
-#ifdef ZMQ_HAVE_WINDOWS
- // Intialise Windows sockets. Note that WSAStartup can be called multiple
- // times given that WSACleanup will be called for each WSAStartup.
- WORD version_requested = MAKEWORD (2, 2);
- WSADATA wsa_data;
- rc = WSAStartup (version_requested, &wsa_data);
- zmq_assert (rc == 0);
- zmq_assert (LOBYTE (wsa_data.wVersion) == 2 &&
- HIBYTE (wsa_data.wVersion) == 2);
-#endif
-
// Initialise the array of mailboxes. Additional three slots are for
// internal log socket and the zmq_term thread the reaper thread.
slot_count = max_sockets + io_threads_ + 3;
@@ -109,12 +98,6 @@ zmq::ctx_t::~ctx_t ()
// needed as mailboxes themselves were deallocated with their
// corresponding io_thread/socket objects.
free (slots);
-
-#ifdef ZMQ_HAVE_WINDOWS
- // On Windows, uninitialise socket layer.
- int rc = WSACleanup ();
- wsa_assert (rc != SOCKET_ERROR);
-#endif
}
int zmq::ctx_t::terminate ()