using System; using System.Collections.Generic; using System.Text; using System.Net; using System.Net.Sockets; using LANMSG.Code; namespace LANMSG.Code { public class Network { private UdpClient udpcli = new UdpClient(); public Network() { udpcli.EnableBroadcast = true; udpcli.BeginReceive(new AsyncCallback(RecvMsg), this); } public void SendMsg(string text) { Byte[] sendBytes = Encoding.ASCII.GetBytes(text); udpcli.Send(sendBytes, sendBytes.Length, "255.255.255.255", 1337); } private void RecvMsg() { } } }