def connectSocket self while self sc isConnected GPSacsrl setGPSTime t

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
def connectSocket(self):
while self.sc.isConnected == 0:
GPSacsrl.setGPSTime()
try:
self.sc.connect()
self.sc.writeUnsignedDecimal(settings.P_AUTH_REQUEST,2)
self.sc.writeUnsignedDecimal(settings.BUS_NUMBER,4)
self.sc.flushBufferWLength()
while 1:
network.handleProtocol(self)
self.gpsParser.fillGPSdata()
if self.sc.isReady:
pass
except EOFError:
self.sc.isReady = 0
self.sc.disconnect()