def generate_simple_response(self, request): # echo the request, except for bytes 4-7, where we put our timestamp return (buffer(request, 0, 4) + (buffer(_s_ulong.pack(ms_time(self.epoch_time()))) + buffer(request, 8)))
def check_send_ack(self): if self._next_ack < self.bytes_read: self.set_next_ack() self.muxer.sendMessage(0, chunks.PROTO_ACK, 0, vb(_s_ulong.pack(self.bytes_read)))
def set_chunk_size(self, new_size): sm = self.protocol.muxer.sendMessage sm(0, chunks.PROTO_SET_CHUNK_SIZE, 0, vb(_s_ulong.pack(new_size))) self.protocol.muxer.set_chunk_size(new_size)