aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authoripknHama <ipknhama@gmail.com>2016-09-10 02:39:22 +0900
committeripknHama <ipknhama@gmail.com>2016-09-10 02:39:22 +0900
commit5ae0dffddfdb1bfba3e250ad9f598c69f9877d22 (patch)
tree56c3bb7719e35a34af8dc92b153d4e290f3695dc /include
parentd07a26f3f8fbbc02f539721bfed1e3191a8154b3 (diff)
downloadcrow-5ae0dffddfdb1bfba3e250ad9f598c69f9877d22.tar.gz
crow-5ae0dffddfdb1bfba3e250ad9f598c69f9877d22.zip
Add a field to websocket::connection for storing user data
Diffstat (limited to 'include')
-rw-r--r--include/websocket.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/websocket.h b/include/websocket.h
index 5299c1a..2873e45 100644
--- a/include/websocket.h
+++ b/include/websocket.h
@@ -22,6 +22,12 @@ namespace crow
virtual void send_text(const std::string& msg) = 0;
virtual void close(const std::string& msg = "quit") = 0;
virtual ~connection(){}
+
+ void userdata(void* u) { userdata_ = u; }
+ void* userdata() { return userdata_; }
+
+ private:
+ void* userdata_;
};
template <typename Adaptor>