comparison core/UdpServer.cpp @ 135:e77e2e712fbc ClockSync

To work with the ClockSync plugin
author Giulio Moro <giuliomoro@yahoo.it>
date Sat, 12 Sep 2015 20:05:55 +0100
parents ff28e56e5b7e
children 134bff10e561
comparison
equal deleted inserted replaced
133:04b1678614c9 135:e77e2e712fbc
2 * udpServer.cpp 2 * udpServer.cpp
3 * 3 *
4 * Created on: 19 May 2015 4 * Created on: 19 May 2015
5 * Author: giulio moro 5 * Author: giulio moro
6 */ 6 */
7 #include "../include/UdpServer.h" 7 #include "UdpServer.h"
8 8
9 UdpServer::UdpServer(int aPort){ 9 UdpServer::UdpServer(int aPort){
10 init(aPort); 10 init(aPort);
11 }; 11 };
12 UdpServer::UdpServer(){ 12 UdpServer::UdpServer(){
27 server.sin_family=AF_INET; 27 server.sin_family=AF_INET;
28 server.sin_addr.s_addr=INADDR_ANY; 28 server.sin_addr.s_addr=INADDR_ANY;
29 enabled=bindToPort(aPort); 29 enabled=bindToPort(aPort);
30 wasteBufferSize=2048; 30 wasteBufferSize=2048;
31 wasteBuffer=malloc(wasteBufferSize); 31 wasteBuffer=malloc(wasteBufferSize);
32 memset(&stTimeOut,0,sizeof(struct timeval));
32 return enabled; 33 return enabled;
33 } 34 }
34 35
35 bool UdpServer::bindToPort(int aPort){ 36 bool UdpServer::bindToPort(int aPort){
36 port=aPort; 37 port=aPort;