]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/socket.h
And the bit I missed... :/
[user/henk/code/inspircd.git] / include / socket.h
index 7dabd4bd3c7d8478163bf7c3862f0d0cf442b954..f8b15ae53cae017fd3188a53c828ff0503f20809 100644 (file)
@@ -22,8 +22,8 @@
 #include <netinet/in.h>
 #include <sstream>
 #include <string>
-#include "dns.h"
 #include <deque>
+#include "dns.h"
 
 /**
  * States which a socket may be in
@@ -50,6 +50,8 @@ class InspSocket
 {
 private:
 
+       std::deque<std::string> outbuffer;
+
        /**
         * The file descriptor of this socket
         */
@@ -63,7 +65,7 @@ private:
        /**
         * The hostname connected to
         */
-       std::string host;
+       char host[MAXBUF];
 
        /**
         * The port connected to, or the port
@@ -112,17 +114,12 @@ private:
         */
        char ibuf[65535];
 
-       /**
-        * The output buffer for this socket
-        */
-       std::deque<std::string> outbuffer;
-
        /**
         * The IP address being connected
         * to stored in string form for
         * easy retrieval by accessors.
         */
-       std::string IP;
+       char IP[MAXBUF];
 
        /**
         * Client sockaddr structure used
@@ -146,8 +143,18 @@ private:
         */
        bool FlushWriteBuffer();
 
+       /** Set the queue sizes
+        * This private method sets the operating system queue
+        * sizes for this socket to 65535 so that it can queue
+        * more information without application-level queueing
+        * which was required in older software.
+        */
        void SetQueues(int nfd);
 
+       /** When the socket has been marked as closing, this flag
+        * will be set to true, then the next time the socket is
+        * examined, the socket is deleted and closed.
+        */
        bool ClosePending;
 
 public:
@@ -326,9 +333,27 @@ public:
         */
        virtual ~InspSocket();
 
+       /**
+        * This method attempts to resolve the hostname,
+        * if a hostname is given and not an IP,
+        * before a connection can occur. This method is
+        * asyncronous.
+        */
        virtual bool DoResolve();
+
+       /**
+        * This method attempts to connect to a hostname.
+        * This only occurs on a non-listening socket. This
+        * method is asyncronous.
+        */
        virtual bool DoConnect();
 
+       /**
+        * This method marks the socket closed.
+        * The next time the core examines a socket marked
+        * as closed, the socket will be closed and the 
+        * memory reclaimed.
+        */
        void MarkAsClosed();
 };