public HTSMsg rcv() throws IOException{
		byte[] lenBytes = new byte[4];
		while (is.available() < 4) {
			try {
				Thread.sleep(10);
			} catch (InterruptedException e) {
			}
		}
		is.read(lenBytes, 0, 4);
		long len = HTSMsg.deserializeS64(lenBytes, 4);
		byte[] msg = new byte[(int)len];
		while (is.available() < len){
			try {
				Thread.sleep(100);
				//TODO check wait time
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		is.read(msg, 0, (int) len);
		HTSMsg htsMsg = new HTSMsg(msg);
		System.out.println("Client"+ clientId +" recived "+ htsMsg.get("method") + " " + htsMsg);
		handleHTSMsg(htsMsg);
		
		return htsMsg; 
	}