コード例 #1
0
        public UdpSocket(IPEndPoint target)
        {
            socket = new UdpClient();

            this.socketState = new UdpState()
            {
                client     = socket,
                dataStream = target
            };
        }
コード例 #2
0
        public void Send(Message msg, AsyncCallback callback, UdpState s)
        {
            var bytes = Serializer.Serialize <Message>(msg);

            socket.BeginSend(bytes, bytes.Length, s.dataStream, callback, s);
        }