@Override
	public void run() {
		if (!mNoFurtherWrites) {
			try {
				// Wait for any pending writes to finish, but not forever
				long maxWait = System.currentTimeMillis() + TimeUnit.MILLISECONDS.convert(1, TimeUnit.MINUTES);
				while (mServer.hasPendingWrite(mChannel) && System.currentTimeMillis() < maxWait) {
					Thread.sleep(50);
				}
			} catch (InterruptedException exception) {
				// Even if interrupted, we still want to try and close the channel
			}
		}
		try {
			mChannel.close();
		} catch (IOException ioe) {
			Log.error(this, ioe);
		}
		mServer.sessionClosed(this);
	}