def send(temperature, humidity, socket):
    dict = {'timestamp': datetime.now().strftime('%X'), 'temperature': temperature, 'humidity': humidity}
    message = json.dumps(dict)
    try:
        socket.send(message)
    except:
        socket.close()
def send(temperature, humidity, socket):
    dict = {'timestamp': datetime.now().strftime('%X'), 'temperature': temperature, 'humidity': humidity}
    message = json.dumps(dict)
    try:
        socket.send(message)
    except:
        socket.close()