public void run() {
		int seconds = 0;
		while(connected) {
			try {
				Thread.sleep(1000);
			}
			catch(InterruptedException e) {
				// nah
			}
			seconds = (seconds + 1) % idleTimeout;
			if(seconds == 0) {
				if(idle) {
					try {
						disconnect();
					}
					catch(IOException e) {
						connected = false;
					}
				}
				else {
					idle = true;
				}
			}
		}
	}