/// <summary> /// Receive callback /// </summary> /// <param name="socket">client socket</param> /// <param name="receivedPacket">received packet</param> public void OnParallelSocketReceived(IParallelSocket socket, ParallelPacket receivedPacket) { byte[] receivedData = receivedPacket.CloneData(); string recvString = ASCIIEncoding.ASCII.GetString(receivedData); Debug.Print("Received [" + receivedPacket.PacketID + "] " + recvString); socket.Send(receivedData); }
/// <summary> /// Send callback /// </summary> /// <param name="socket">client socket</param> /// <param name="status">stend status</param> /// <param name="sentPacket">sent packet</param> public void OnParallelSocketSent(IParallelSocket socket, SendStatus status, ParallelPacket sentPacket) { string sentString = ASCIIEncoding.ASCII.GetString(sentPacket.CloneData()); Debug.Print("Sent [" + sentPacket.PacketID + "] " + sentString); }
/// <summary> /// Receive callback /// </summary> /// <param name="client">client</param> /// <param name="receivedPacket">received packet</param> public void OnParallelClientReceived(IParallelClient client, ParallelPacket receivedPacket) { string recvString=ASCIIEncoding.ASCII.GetString(receivedPacket.CloneData()); Debug.Print("Received [" + receivedPacket.PacketID + "] " + recvString); }