From: Vlad S. <ser...@us...> - 2005-08-07 22:15:18
|
Update of /cvsroot/naviserver/modules/nsudp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1713/nsudp Modified Files: nsudp.c Log Message: added support of broadcasting to all udp commands Index: nsudp.c =================================================================== RCS file: /cvsroot/naviserver/modules/nsudp/nsudp.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** nsudp.c 1 Aug 2005 19:49:53 -0000 1.3 --- nsudp.c 7 Aug 2005 22:15:09 -0000 1.4 *************** *** 170,174 **** int salen = sizeof(sa); char *address = 0, *data = 0; ! int sock, len, port, timeout = 5, retries = 1, noreply = 0; Ns_ObjvSpec opts[] = { --- 170,174 ---- int salen = sizeof(sa); char *address = 0, *data = 0; ! int i, sock, len, port, timeout = 5, retries = 1, noreply = 0; Ns_ObjvSpec opts[] = { *************** *** 199,202 **** --- 199,206 ---- return TCL_ERROR; } + /* To support brodcasting addresses */ + i = 1; + setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &i, sizeof(int)); + resend: if (sendto(sock, data, len, 0,(struct sockaddr*)&sa,sizeof(sa)) < 0) { |