public void write_message(JOutPiqi.response r) throws IOException {
		OutputStream os = socket.getOutputStream();

		if (r != null) {
			byte[] ret = r.toByteArray();
			java.nio.ByteBuffer bb = java.nio.ByteBuffer.allocate(ret.length + 4);
			bb.putInt(ret.length & 0x7fffff);
			bb.put(ret);
			os.write(bb.array());
		}

		os.flush();
	}