Hi, ppl. The problem is that this function works good. It is sending upd packet.
I use it in timer. So it's goes to net every second. But the problem is that through
some time there is message box appearing and saying that socket buffer is too small or queue is overfill. What is it?
ckCode:public void SendBroadBandMessage() { this.broadcastSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); this.broadcastSocket.SendTimeout = 100; this.broadcastSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1); byte[] _data = Encoding.ASCII.GetBytes("1234"); IPEndPoint _ipoint = new IPEndPoint(IPAddress.Broadcast, 7777); try { this.broadcastSocket.SendTo(_data, _ipoint); } catch (SocketException _so) { MessageBox.Show(""); } this.broadcastSocket.Shutdown(SocketShutdown.Both); this.broadcastSocket.Close(); this.broadcastSocket = null; }




Reply With Quote