class TCP(QtCore.QThread): def __init__(self, ip, port, queue, coms): super(TCP, self).__init__() self.con = TCPClient(ip, port) self.q = queue self.coms = coms def run(self): while True: data = self.con.recvmostrecent() self.q.put(data) self.coms.up.emit()
from TCPIPWrapper import TCPClient s = TCPClient("d-173-250-205-216.dhcp4.washington.edu", 2223) while True: print s.recvmostrecent()
def __init__(self, ip, port, queue, coms): super(TCP, self).__init__() self.con = TCPClient(ip, port) self.q = queue self.coms = coms