Loading kinetic/baseclient.py +13 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import struct import common import kinetic_pb2 as messages import ssl import operations ss = socket Loading Loading @@ -139,6 +140,16 @@ class BaseClient(object): self.connection_id = int(time.time()) self._closed = False self._handshake() def _handshake(self): # Connection id handshake h,v = operations.Noop.build() self.update_header(h) self.network_send(h,v) r = self.network_recv() print "Connection: " + str(self.connection_id) def has_data_available(self): tmp = self._socket.recv(1, socket.MSG_PEEK) return len(tmp) > 0 Loading Loading @@ -288,6 +299,7 @@ class BaseClient(object): resp = self._recv_delimited_v2() # update connectionId to whatever the drive said. if resp[0].command.header.connectionID: self.connection_id = resp[0].command.header.connectionID return resp Loading Loading
kinetic/baseclient.py +13 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import struct import common import kinetic_pb2 as messages import ssl import operations ss = socket Loading Loading @@ -139,6 +140,16 @@ class BaseClient(object): self.connection_id = int(time.time()) self._closed = False self._handshake() def _handshake(self): # Connection id handshake h,v = operations.Noop.build() self.update_header(h) self.network_send(h,v) r = self.network_recv() print "Connection: " + str(self.connection_id) def has_data_available(self): tmp = self._socket.recv(1, socket.MSG_PEEK) return len(tmp) > 0 Loading Loading @@ -288,6 +299,7 @@ class BaseClient(object): resp = self._recv_delimited_v2() # update connectionId to whatever the drive said. if resp[0].command.header.connectionID: self.connection_id = resp[0].command.header.connectionID return resp Loading