|
@@ -14,7 +14,7 @@ class ClientProtocol(basic_protocols.Protocol):
|
|
|
self.send_buffer_len = send_buffer_len
|
|
|
self.use_acceleration = use_acceleration
|
|
|
#
|
|
|
- self.states = enum.Enum('CLIENT_CONN_STATES', 'READY_TO_BEGIN SEND_GROUP_ID PUSH_DATA DONE')
|
|
|
+ self.states = enum.Enum('CLIENT_CONN_STATES', 'READY_TO_BEGIN SEND_GROUP_ID WAIT PUSH_DATA DONE')
|
|
|
self.state = self.states.READY_TO_BEGIN
|
|
|
#
|
|
|
self.sub_protocol = None
|
|
@@ -28,10 +28,15 @@ class ClientProtocol(basic_protocols.Protocol):
|
|
|
self.state = self.states.SEND_GROUP_ID
|
|
|
#
|
|
|
if self.state is self.states.SEND_GROUP_ID:
|
|
|
+ if self.sub_protocol.run(block=block):
|
|
|
+ self.state = self.states.WAIT
|
|
|
+ #
|
|
|
+ #
|
|
|
+ if self.state is self.states.WAIT:
|
|
|
if block and self.wait_until is not None:
|
|
|
time.sleep(self.wait_until-time.time())
|
|
|
#
|
|
|
- if (self.wait_until is None or time.time() >= self.wait_until) and self.sub_protocol.run(block=block):
|
|
|
+ if self.wait_until is None or time.time() >= self.wait_until:
|
|
|
self.sub_protocol = basic_protocols.PushDataProtocol(self.socket, self.total_bytes,
|
|
|
send_buffer_len=self.send_buffer_len,
|
|
|
use_acceleration=self.use_acceleration)
|