예제 #1
0
def send(destination, data, datatype):
    """
    Sends data to a specific destination. For valid datatyp-strings, check requesthandler.py
    """
    print "Trying to send"
    client = Client(destination)
    client.clientStart()
    msg = pickle.dumps(data) + "<>" + datatype + "<>" + str(SETTINGS.employee_id)
    print str(SETTINGS.employee_id)
    client.send(msg)
    client.close()
예제 #2
0
def send(destination, data, datatype):
    """
    Sends data to a specific destination. For valid datatyp-strings, check requesthandler.py
    """
    msg = pickle.dumps(data) + "<>" + datatype
    lock.acquire()
    client = Client(destination)
    try:
        client.clientStart()
        client.send(msg)
        print "Client sent"
        client.close()
        lock.release()
    except:
        lock.release()
        raise