diff core/UdpClient.cpp @ 267:247a182adb6d prerelease

Makefile creates build folder in the script folder
author Giulio Moro <giuliomoro@yahoo.it>
date Tue, 17 May 2016 14:38:03 +0100
parents c42a6b4dc2d4
children a14fe8b0f588
line wrap: on
line diff
--- a/core/UdpClient.cpp	Tue May 17 14:07:01 2016 +0100
+++ b/core/UdpClient.cpp	Tue May 17 14:38:03 2016 +0100
@@ -8,6 +8,9 @@
 
 	UdpClient::UdpClient(){
 		outSocket=socket(AF_INET, SOCK_DGRAM, 0);
+		int broadcastEnable = 1;
+		int ret = setsockopt(outSocket, SOL_SOCKET, SO_BROADCAST, &broadcastEnable, sizeof(broadcastEnable));
+		printf("setsockopt returned %d\n", ret);
 		isSetPort=false;
 		isSetServer=false;
 		enabled=false;
@@ -74,4 +77,4 @@
 	stTimeOut.tv_usec=(int)(timeOutSecs*1000000);
     int descriptorReady= select(outSocket+1, NULL, &stWriteFDS, NULL, &stTimeOut);
     return descriptorReady>0? 1 : descriptorReady;
-  }
\ No newline at end of file
+  }