hpimdm/Run.py
def client_socket(data_to_send, print_output=True):
    """
    Send command to daemon process through a socket
    """
    # Create a UDS socket
    sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)

    # Connect the socket to the port where the server is listening
    server_address = hpim_globals.DAEMON_SOCKET.format(hpim_globals.MULTICAST_TABLE_ID)
    #print('connecting to %s' % server_address)
    try:
        sock.connect(server_address)
        sock.sendall(pickle.dumps(data_to_send))
        data_rcv = sock.recv(1024 * 256)
        if data_rcv:
            if print_output:
                print(pickle.loads(data_rcv))
            else:
                return pickle.loads(data_rcv)
    except socket.error:
        pass
    finally:
        #print('closing socket')
        sock.close()

    Send command to daemon process through a socket
    
Send command to daemon process through a socket
Send command to daemon process through a socket
def client_socket(data_to_send, print_output=True):
    sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
    server_address = hpim_globals.DAEMON_SOCKET.format(hpim_globals.MULTICAST_TABLE_ID)
    try:
        sock.connect(server_address)
        sock.sendall(pickle.dumps(data_to_send))
        data_rcv = sock.recv(1024 * 256)
        if data_rcv:
            if print_output:
                print(pickle.loads(data_rcv))
            else:
                return pickle.loads(data_rcv)
    except socket.error:
        pass
    finally:
        sock.close()
def client_socket ( data_to_send , print_output = True ) : sock = socket . socket ( socket . AF_UNIX , socket . SOCK_STREAM ) server_address = hpim_globals . DAEMON_SOCKET . format ( hpim_globals . MULTICAST_TABLE_ID ) try : sock . connect ( server_address ) sock . sendall ( pickle . dumps ( data_to_send ) ) data_rcv = sock . recv ( 1024 * 256 ) if data_rcv : if print_output : print ( pickle . loads ( data_rcv ) ) else : return pickle . loads ( data_rcv ) except socket . error : pass finally : sock . close ( )
Send command to daemon process through a socket
Send command to daemon process through a socket
"""
    Send command to daemon process through a socket
    """ # Create a UDS socket # Connect the socket to the port where the server is listening #print('connecting to %s' % server_address) #print('closing socket')
data_to_send
print_output