示例#1
0
        private void TcpDataReceived(TcpConnection source, TcpDataReceivedEventArgs e)
        {
            switch (JsonConvert.DeserializeObject<RequestModel>(e.Data).Action)
            {

            }
        }
示例#2
0
 private void TcpAccept(IAsyncResult ar)
 {
     var socket = new TcpConnection(TcpListener.EndAcceptSocket(ar));
     socket.DataReceived += TcpDataReceived;
     socket.ConnectionClosed += (o, e) => { Connections.Remove((TcpConnection)o); };
     Connections.Add(socket);
 }