Example #1
0
        private void exit()
        {
            SpinWait.SpinUntil(() => client.P2PSocketList.Count == 0);

            if (type == ProtocolType.Udp)
            {
                using (Packet packet = new Packet(client.RemoteEndPoint))
                {
                    packet.BeginWrite(PacketType.CONNECTION_LOST);
                    client.Send(packet);
                }
            }
            client.PushPacket(PacketType.CONNECTION_LOST, "主動斷線");
        }