コード例 #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="client"></param>
        public GpspClient(TcpClient client)
        {
            // Set disposed to false!
            this.Disposed = false;

            // Set the client variable
            this.Client = client;
            this.ClientEP = client.Client.RemoteEndPoint;
            LoginServer.Log("[GPSP] Client Connected: {0}", ClientEP);

            // Init a new client stream class
            Stream = new TcpClientStream(client);
            Stream.DataReceived += new DataRecivedEvent(Stream_DataReceived);
            Stream.OnDisconnect += new ConnectionClosed(Stream_OnDisconnect);
        }
コード例 #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="client"></param>
        public GpspClient(TcpClient client)
        {
            // Set disposed to false!
            this.Disposed = false;

            // Set the client variable
            this.Client = client;

            // Init a new client stream class
            Stream = new TcpClientStream(client);

            // Handle client communications in a background thread
            ClientThread = new Thread(new ThreadStart(Start));
            ClientThread.IsBackground = true;
            ClientThread.Start();
        }
コード例 #3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="Client">The Tcp Client connection</param>
        public GpcmClient(TcpClient Client)
        {
            // Set default variable values
            ClientNick = "Connecting...";
            Connection = Client;
            ClientEP = Connection.Client.RemoteEndPoint;
            IpAddress = ((IPEndPoint)ClientEP).Address;
            Disposed = false;

            // Create our Client Stream
            Stream = new TcpClientStream(Client);
            Stream.DataReceived += new DataRecivedEvent(Stream_DataReceived);
            Stream.OnDisconnect += new ConnectionClosed(Stream_OnDisconnect);

            // Log Incoming Connections
            LoginServer.Log("[GPCM] Client Connected: {0}", ClientEP);

            // Start by sending the server challenge
            SendServerChallenge();
        }
コード例 #4
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="Client">The Tcp Client connection</param>
        public GpcmClient(TcpClient Client)
        {
            // Set default variable values
            ClientNick = "Connecting...";
            Connection = Client;
            IpAddress = ((IPEndPoint)Connection.Client.RemoteEndPoint).Address;
            Stream = new TcpClientStream(Client);
            Disposed = false;

            // Handle client communications in a background thread
            ClientThread = new Thread(new ThreadStart(HandleClient));
            ClientThread.IsBackground = true;
            ClientThread.Start();
        }