Example #1
0
 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)))
Example #2
0
 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)))
Example #3
0
 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)
Example #4
0
 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)))
Example #5
0
 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)
Example #6
0
 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)))