Example #1
0
		public NetState(Socket socket, SocketConnector messagePump) {
			mSocket = socket;
			mBuffer = new ByteQueue();
			Seeded = false;
			mRunning = false;
			mRecvBuffer = new byte[BufferSize];
			mMessagePump = messagePump;

			mSendQueue = new SendQueue();
			UpdateAcitivty();

			mInstances.Add(this);

			try {
				mAddress = ((IPEndPoint)mSocket.RemoteEndPoint).Address.Intern();
				mToString = mAddress.ToString();
			} catch (Exception ex) {
				throw;
			}

			mConnectedOn = DateTime.Now;

			if (mCreatedCallback != null) {
				mCreatedCallback(this);
			}
		}