summaryrefslogtreecommitdiff
path: root/include/inspsocket.h
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-10-16 14:53:27 +0100
committerPeter Powell <petpow@saberuk.com>2018-10-25 13:50:43 +0100
commitd62c870ffb1bf02e4be65183f3ae4bbe2229fbb2 (patch)
treee8163ce84e879e501909fff1472419a2916a2e30 /include/inspsocket.h
parentda96cf374de819399136023f6bc30dc30affd156 (diff)
Store the type of a StreamSocket within itself.
Similar to with IOHooks this allows you to convert StreamSocket to a UserIOHandler quickly.
Diffstat (limited to 'include/inspsocket.h')
-rw-r--r--include/inspsocket.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/inspsocket.h b/include/inspsocket.h
index d88c350ba..e432f9c16 100644
--- a/include/inspsocket.h
+++ b/include/inspsocket.h
@@ -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();