summary refs log tree commit diff
path: root/rtc/src/rtcPeerHandler.hpp
blob: 3ba32a8325ca2cdaeb73c51d200875fa631bd7b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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