コード例 #1
0
 /// <summary>
 /// Creates a new connection manager of thisitem
 /// </summary>
 /// <param name="ip">The ip to connect to</param>
 /// <param name="port">The port that should be contacted</param>
 public ClientConnectionManager(string ip, int port)
 {
     this.ip = ip;
     this.port = port;
     connection = new ClientSocketInformation(ip, port, true);
     connection.connectionChanged += reportNewConnectionState;
     connection.packetArrival += packetArrival;
     processor = new PacketProcessor();
 }
コード例 #2
0
 public ASyncMainServerConnection(string ip, int port, string licenseID, int slots)
 {
     this.notInDemoMode = true;
     this.RSAService = new RSAHandler();
     this.ClientModule = new ClientSocketInformation(ip, port, true);
     this.ClientModule.connectionChanged += ClientModule_connectionChanged;
     this.ClientModule.packetArrival += OnNewPacket;
     this.licenseID = licenseID;
     this.Slots = Slots;
     monitorThread = new Thread(CheckLoop);
     monitorThread.Start();
 }
コード例 #3
0
        /// <summary>
        /// Resets the connection and cleans the packet register
        /// </summary>
        public void reset()
        {
            connection.Dispose();
            connection.connectionChanged -= reportNewConnectionState;
            connection.packetArrival -= packetArrival;

            connection = new ClientSocketInformation(ip, port, true);
            connection.connectionChanged += reportNewConnectionState;
            connection.packetArrival += packetArrival;
            processor = new PacketProcessor();
        }