summaryrefslogtreecommitdiffstats
path: root/external/optick/optick_server.h
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2019-04-30 13:12:35 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2019-04-30 13:12:35 +0200
commit868ba6279a20e4d1412c2d576c67400167de6694 (patch)
treea7090b2da96987c4c532c5bedf812df20f604964 /external/optick/optick_server.h
parentSecond iteration of changing to single-threaded model (diff)
downloadAltCraft-868ba6279a20e4d1412c2d576c67400167de6694.tar
AltCraft-868ba6279a20e4d1412c2d576c67400167de6694.tar.gz
AltCraft-868ba6279a20e4d1412c2d576c67400167de6694.tar.bz2
AltCraft-868ba6279a20e4d1412c2d576c67400167de6694.tar.lz
AltCraft-868ba6279a20e4d1412c2d576c67400167de6694.tar.xz
AltCraft-868ba6279a20e4d1412c2d576c67400167de6694.tar.zst
AltCraft-868ba6279a20e4d1412c2d576c67400167de6694.zip
Diffstat (limited to 'external/optick/optick_server.h')
-rw-r--r--external/optick/optick_server.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/external/optick/optick_server.h b/external/optick/optick_server.h
new file mode 100644
index 0000000..b44153e
--- /dev/null
+++ b/external/optick/optick_server.h
@@ -0,0 +1,42 @@
+#pragma once
+#include "optick.config.h"
+
+#if USE_OPTICK
+#include "optick_message.h"
+
+#include <mutex>
+#include <thread>
+
+namespace Optick
+{
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+class Socket;
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+class Server
+{
+ InputDataStream networkStream;
+
+ static const int BIFFER_SIZE = 1024;
+ char buffer[BIFFER_SIZE];
+
+ Socket* socket;
+
+ std::recursive_mutex socketLock;
+
+ Server( short port );
+ ~Server();
+
+ bool InitConnection();
+
+public:
+ void Send(DataResponse::Type type, OutputDataStream& stream = OutputDataStream::Empty);
+ void Update();
+
+ string GetHostName() const;
+
+ static Server &Get();
+};
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+}
+
+#endif //USE_OPTICK \ No newline at end of file