summaryrefslogtreecommitdiff
path: root/src/sockets.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-02-14 15:13:27 -0500
committerAdam <Adam@anope.org>2012-02-14 15:13:27 -0500
commita9772cde21407c89abd161d51aff45267f87b1fb (patch)
tree9e57ba6c121d3843888917d968dd4f5d030b57cf /src/sockets.cpp
parent086790d6331357022f4da17c76b26b9fc6e2ad90 (diff)
Clean up and reorganize our header files
Diffstat (limited to 'src/sockets.cpp')
-rw-r--r--src/sockets.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/sockets.cpp b/src/sockets.cpp
index 9b985a504..ebaf8f5a3 100644
--- a/src/sockets.cpp
+++ b/src/sockets.cpp
@@ -1,17 +1,38 @@
+/*
+ *
+ * (C) 2003-2012 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ */
+
#include "services.h"
+#include "sockets.h"
+#include "socketengine.h"
+#include "logger.h"
+
+#include <arpa/inet.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
std::map<int, Socket *> SocketEngine::Sockets;
-int32_t TotalRead = 0;
-int32_t TotalWritten = 0;
+uint32_t TotalRead = 0;
+uint32_t TotalWritten = 0;
SocketIO normalSocketIO;
/** Construct the object, sets everything to 0
*/
-sockaddrs::sockaddrs()
+sockaddrs::sockaddrs(const Anope::string &address)
{
this->clear();
+ if (!address.empty())
+ this->pton(address.find(':') != Anope::string::npos ? AF_INET6 : AF_INET, address);
}
/** Memset the object to 0