Exemplo n.º 1
0
def runCommunications():
    global receive_message
    global elapse

    communication = Communication()

    while True:
        start = time.time()

        if settings.on:
            try:
                experiences2 = communication.receive('')
                count = len(experiences2.timestamps)
                experiences2.append('server_experiences')
                receive_message = 'Received ' + str(count)
            except (ConnectionRefusedError, ConnectionResetError) as e:
                receive_message = e.strerror
        else:
            receive_message = ''
            time.sleep(.1)

        elapse = time.time() - start
Exemplo n.º 2
0
#!/usr/bin/python3

from Communication import Communication
from Experiences import Experiences
import time

communication = Communication()

while True:
    experiences = communication.receive('')
    print(experiences)
    time.sleep(1)