websockets.py (1424:449e7e7d25c9) websockets.py (1433:bcdf5daaf688)
1import re
2import random
3import base64
4import struct
5import select
6import hashlib
7import itertools
8from unit.applications.proto import TestApplicationProto

--- 207 unchanged lines hidden (view full) ---

216 end = min(pos + fragmention_size, message_len)
217 fin = end == message_len
218 self.frame_write(
219 sock, op_code, message[pos:end], fin=fin, **kwargs
220 )
221 op_code = self.OP_CONT
222 pos = end
223
1import re
2import random
3import base64
4import struct
5import select
6import hashlib
7import itertools
8from unit.applications.proto import TestApplicationProto

--- 207 unchanged lines hidden (view full) ---

216 end = min(pos + fragmention_size, message_len)
217 fin = end == message_len
218 self.frame_write(
219 sock, op_code, message[pos:end], fin=fin, **kwargs
220 )
221 op_code = self.OP_CONT
222 pos = end
223
224 def message_read(self, sock, read_timeout=10):
224 def message_read(self, sock, read_timeout=60):
225 frame = self.frame_read(sock, read_timeout=read_timeout)
226
227 while not frame['fin']:
228 temp = self.frame_read(sock, read_timeout=read_timeout)
229 frame['data'] += temp['data']
230 frame['fin'] = temp['fin']
231
232 return frame
225 frame = self.frame_read(sock, read_timeout=read_timeout)
226
227 while not frame['fin']:
228 temp = self.frame_read(sock, read_timeout=read_timeout)
229 frame['data'] += temp['data']
230 frame['fin'] = temp['fin']
231
232 return frame