Beispiel #1
0
		public TcpConnection(Socket socket)
		{
			trace.Header = socket.RemoteEndPoint.ToString();

			trace.TraceInformation("New Connection");

			if (socket.Connected == false)
				throw new Exception();

			m_socket = socket;
			m_netStream = new GameNetStream(socket);

			m_deserializerThread = new Thread(DeserializerMain);
			m_deserializerThread.Start();
		}
        public TcpConnection(Socket socket, INetStatCollector netStatCollector = null, string debugName = null)
        {
            trace.Header       = socket.RemoteEndPoint.ToString();
            m_netStatCollector = netStatCollector;

            trace.TraceInformation("New Connection");

            if (socket.Connected == false)
            {
                throw new Exception();
            }

            m_socket    = socket;
            m_netStream = new GameNetStream(socket);

            m_deserializerThread      = new Thread(DeserializerMain);
            m_deserializerThread.Name = debugName;
            m_deserializerThread.Start();
        }