summary refs log tree commit diff
path: root/src/rtcPeerHandler.hpp
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:32:55 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:32:55 +0200
commitf46ca1c3415357d6fd582a582a642179c4455b1f (patch)
tree1609cf3a6be54fd03ea3d04b57e701e22be5f42c /src/rtcPeerHandler.hpp
parentMerge branch 'master' into util (diff)
parentMerge pull request #21 from ItsNewe/master (diff)
downloadserver-f46ca1c3415357d6fd582a582a642179c4455b1f.tar.xz
Merge branch 'rtc'
Diffstat (limited to '')
-rw-r--r--src/rtcPeerHandler.hpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/rtcPeerHandler.hpp b/src/rtcPeerHandler.hpp
new file mode 100644

index 00000000..3ba32a83 --- /dev/null +++ b/src/rtcPeerHandler.hpp
@@ -0,0 +1,32 @@ +#include "libdatachannel/rtc.hpp" +#include <iostream> +#include <memory> +#include "nlohmann/json.hpp" +#include <array> + +#ifdef _WIN32 +#include <winsock2.h> +#else +#include <arpa/inet.h> +typedef int SOCKET; +#endif + +using json = nlohmann::json; + +#ifndef RTCPEERHANDLER +#define RTCPEERHANDLER +class rtcPeerHandler{ +public: + rtcPeerHandler(); + void initiateConnection(std::string peerIP, int peerPort); + + struct client + { + std::shared_ptr<rtc::PeerConnection> pc; + std::shared_ptr<rtc::DataChannel> dc; + }; + +private: + std::map<SOCKET, client> clients; +}; +#endif \ No newline at end of file