summaryrefslogtreecommitdiff
path: root/includes/Socket.h
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-10-17 23:06:29 -0700
committerPixel <pixel@nobis-crew.org>2011-10-17 23:06:57 -0700
commitea271d967c52892a61f2b2db754780912e0f7cef (patch)
tree9cc70e5adfb75699291471ff4a5a6e9532c0002c /includes/Socket.h
parent58f4ba6c8a4f9662dad9f5ddb3106c2e2c34daa6 (diff)
Making some adjustments to get the Socket code compiling under mingw32. Doesn't work though; I'm guessing IPv6 isn't really mingw32 thing. At least, it's not WinXP's. Will try later to make something that switches between IPv4 and IPv6 intelligently.
Diffstat (limited to 'includes/Socket.h')
-rw-r--r--includes/Socket.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/includes/Socket.h b/includes/Socket.h
index 1f20fbb..b762d9b 100644
--- a/includes/Socket.h
+++ b/includes/Socket.h
@@ -1,6 +1,12 @@
#pragma once
+#ifdef _WIN32
+#include <windows.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#else
#include <netdb.h>
+#endif
#include <Handle.h>
#include <Task.h>
#include <Printer.h>
@@ -53,7 +59,8 @@ class Listener : public Task {
public:
Listener(int port, const char * local = NULL) : m_stop(false) {
m_listener.setLocal(local, port);
- m_listener.listen();
+ bool r = m_listener.listen();
+ Assert(r);
m_name = String(ClassName(this).c_str()) + " - " + m_listener.getName();
Printer::elog(E_SOCKET, "Created a listener task at %p", this);
}