forked from chenxiaoqino/udp-image-streaming
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathServDelegate.h
45 lines (32 loc) · 894 Bytes
/
ServDelegate.h
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
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// Created by chenyuan on 7/29/19.
//
#ifndef SERVDELEGATE_H
#define SERVDELEGATE_H
#include <vector>
#include <atomic>
#include "PracticalSocket.h"
#include "config.h"
#include "Machine.h"
// OpenPose dependencies
#include <openpose/headers.hpp>
#define PORT 10101
using namespace std;
class ServDelegate {
public:
ServDelegate();
~ServDelegate();
void sendTo(vector< unsigned char> &data);
void setForeignAddress(const string &foreignAddress);
void setForeignPort(unsigned short foreignPort);
UDPSocket sock_;
op::Wrapper opWrapper{op::ThreadManagerMode::Asynchronous};
Machine fsm_;
void cmdHandle();
void sendHandle();
private:
string foreignAddress_="127.0.0.1";
unsigned short foreignPort_=10100;
void printKeypoints(const std::shared_ptr<std::vector<std::shared_ptr<op::Datum>>>& datumsPtr);
};
#endif //SERVDELEGATE_H