Lines Matching refs:request
49 def _read(request, length): argument
50 bytes = request.connection.read(length)
54 (request.connection.remote_addr,))
58 def _write(request, bytes): argument
60 request.connection.write(bytes)
64 (request.connection.remote_addr,),
69 def send_message(request, message): argument
77 _write(request, '\x00' + message.encode('utf-8') + '\xff')
80 def receive_message(request): argument
91 frame_type_str = _read(request, 1)
96 length = _payload_length(request)
97 _receive_bytes(request, length)
100 bytes = _read_until(request, '\xff')
109 def _payload_length(request): argument
112 b_str = _read(request, 1)
120 def _receive_bytes(request, length): argument
123 new_bytes = _read(request, length)
129 def _read_until(request, delim_char): argument
132 ch = _read(request, 1)
149 def __init__(self, request, onmessage=None): argument
161 self._request = request
216 def __init__(self, request): argument
223 self._request = request