Skip to content
Snippets Groups Projects
Commit 0cdce73c authored by Robin Mueller's avatar Robin Mueller
Browse files

some more stufsome more stufff

parent 30ce09e9
No related branches found
No related tags found
No related merge requests found
from multiprocessing.connection import Client
address = ('localhost', 6000)
conn = Client(address, authkey=None)
conn.send('close')
# can also send arbitrary objects:
# conn.send(['a', 2.5, None, int, sum])
conn.close()
from multiprocessing.connection import Listener
from multiprocessing import Process
address = ('localhost', 6000) # family is deduced to be 'AF_INET'
listener = Listener(address, authkey=None)
conn = listener.accept()
print('connection accepted from' + str(listener.last_accepted))
while True:
msg = conn.recv()
# do something with msg
if msg == 'close':
conn.close()
break
listener.close()
...@@ -43,9 +43,9 @@ class TmTcGUI(Process): ...@@ -43,9 +43,9 @@ class TmTcGUI(Process):
while True: while True:
self.conn.send("test") self.conn.send("test")
self.root.update() self.root.update()
time.sleep(2) time.sleep(0.1)
self.counter = self.counter + 1 self.counter = self.counter + 1
if self.counter == 3: if self.counter == 50:
self.conn.send("close") self.conn.send("close")
self.conn.close() self.conn.close()
break break
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment