def test(): pool=connectPool() _thread.start_new_thread(netConfigServer.netConfigServer, (pool, )) heartbeatserver=heartBeatServer(pool) heartbeatserver.start() time.sleep(30)
def mainServer(): pool=connectPool() #_thread.start_new_thread(busDataServe, (0, )) #_thread.start_new_thread(reciveHeartBeat, (pool, )) #_thread.start_new_thread(netConfigServer, (pool, )) busdataserver=busDataServer(busCalculate.calculateBusPosition) busdataserver.start() heartbeatserver=heartBeatServer(pool) heartbeatserver.start() infosendingserver=infoSendingServer(pool) infosendingserver.start() return
arr=s.split(',')#暂时用逗号 No=int(arr[1]) if arr[0]=='1': #test code here send_line(int(arr[2]), No, pool) if arr[0]=='2': send_text(int(arr[2]), arr[3],arr[4], arr[5], No, pool) if arr[0]=='3': send_clear_text(int(arr[2]), No, pool) if arr[0]=='4': send_speed(int(arr[2]), int(arr[3]), int(arr[4]), No, pool) conn.close() return if __name__=='__main__': print('test') from connectPool import connectPool #eNo=1 pool=connectPool() #busstop_table=table_busStop() #busstop_table.readFromFile() #netConfigServer(ip_table, busstop_table) #just test send_line function #ip=ip_table.getIP(1) #send_line(3, eNo, pool) #send_text(R_No, name, msg1, msg2, No, pool): send_text(1, '104', 'fff', 'xxx', 1, pool) netConfigServer(pool)