diff core/UdpClient.cpp @ 274:cf98c06c72fd prerelease

merge
author Liam Donovan <l.b.donovan@qmul.ac.uk>
date Tue, 17 May 2016 16:42:02 +0100
parents 247a182adb6d
children a14fe8b0f588
line wrap: on
line diff
--- a/core/UdpClient.cpp	Tue May 17 16:31:51 2016 +0100
+++ b/core/UdpClient.cpp	Tue May 17 16:42:02 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
+  }