public void close() {
		synchronized (socket) {
			if (close) {
				return;	
			}
			close = true;
			serv.closeid(cid);
			try {
				fromClient.close();
				toClient.close();
				socket.close();
			} catch(IOException e) {
				System.err.println("ajserver: an error occured while trying to close client " + cid);
			}		
		}
	}