blob: b90de52b15db69b3382a43c1b04ba725bed88504 (
plain)
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
|
#include "UDPServer/UDPServer.h"
#include <iostream>
#include <string>
int main (int argc, char *argv[]){
std::cout << "Receiving UDP packages: " << std::endl;
std::string address = "localhost";
int port = 1234;
UDPServer server = UDPServer(address, port);
std::size_t length{8000};
char buf[length];
server.recv(buf, length);
for(auto i = 0; i < length; i++){
printf("%c", buf[i]);
}
printf("\n");
return 0;
}
|