public UdpSocket(IPEndPoint target) { socket = new UdpClient(); this.socketState = new UdpState() { client = socket, dataStream = target }; }
public void Send(Message msg, AsyncCallback callback, UdpState s) { var bytes = Serializer.Serialize <Message>(msg); socket.BeginSend(bytes, bytes.Length, s.dataStream, callback, s); }