]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspsocket.h
Store the type of a StreamSocket within itself.
[user/henk/code/inspircd.git] / include / inspsocket.h
index d88c350ba966a2fb58d76e8629aca096ad2f3b7f..e432f9c16c130600ede422b4e7dbb41fc38cf3cf 100644 (file)
@@ -219,6 +219,13 @@ class CoreExport StreamSocket : public EventHandler
                size_t nbytes;
        };
 
+       /** The type of socket this IOHook represents. */
+       enum Type
+       {
+               SS_UNKNOWN,
+               SS_USER
+       };
+
  private:
        /** The IOHook that handles raw I/O for this socket, or NULL */
        IOHook* iohook;
@@ -264,7 +271,12 @@ class CoreExport StreamSocket : public EventHandler
  protected:
        std::string recvq;
  public:
-       StreamSocket() : iohook(NULL) { }
+       const Type type;
+       StreamSocket(Type sstype = SS_UNKNOWN)
+               : iohook(NULL)
+               , type(sstype)
+       {
+       }
        IOHook* GetIOHook() const;
        void AddIOHook(IOHook* hook);
        void DelIOHook();