-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathServer.cpp
More file actions
44 lines (42 loc) · 720 Bytes
/
Server.cpp
File metadata and controls
44 lines (42 loc) · 720 Bytes
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
#include "SocketMatTransmissionServer.h"
int main()
{
SocketMatTransmissionServer socketMat;
if (socketMat.socketInit(6666) < 0)
{
return 0;
}
cv::Mat img_r;
int key = -1;
int n = -1;
while(1)
{
if (socketMat.socketConnect() < 0)
{
continue;
}
while (1)
{
n = socketMat.receive(img_r);
if(n > 0)
{
printf("Server recv!\n");
socketMat.transmit(img_r);
//cv::imshow("Server",img_r);
//key = cv::waitKey(1);
//if (key == 'q')
// break;
}
else
{
printf("Server recv error!\n");
break;
}
//printf("Server !!!!!\n");
//socketMat.transmit(img_r);
}
//socketMat.socketDisconnect();
}
socketMat.socketDisconnect();
return 0;
}