UDP broadcast problem
C#
1
Posts
1
Posters
0
Views
1
Watching
-
System.Net.IPEndPoint broadCastEndpoint=new IPEndPoint(System.Net.IPAddress.Broadcast,BGAME_PORT); while(broadCastFlag) { try{ bsocket.SendTo(buffer,buffer.Length,SocketFlags.None,broadCastEndpoint); Thread.Sleep(BGAME_INTERVAL); } catch(System.Net.Sockets.SocketException e) { System.Console.Out.WriteLine(e.ToString()); } } I just wanna broadcast a UDP packet to the LAN, as u see above. but when the code runs to 'Send to' method, an exception is throwed and tell me that 'attempt to access the socket in a unauthorized way' Why? Thanks.