summaryrefslogtreecommitdiffstats
path: root/src/main_server.cpp
blob: 167dfca61644a415133af020feb18dbab65b0ac7 (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 = "10.0.0.10";
  int port = 4000;

  UDPServer server = UDPServer(address, port);

  std::size_t length{16*500};

  unsigned short buf[length];

  server.recv((char *)buf, length*sizeof(unsigned short));

  for(auto i = 0; i < length; i++){
    printf("%i ", buf[i]);
  }
  printf("\n");

  return 0;

}