

def send(sock, command, arguments=''):
    ' Send a command with arguments (both strings) through a socket. This\n        information is encoded with length information to ensure that everything\n        is received.\n    '
    (sent, total) = (0, 0)
    msg = ((command + MESSAGE_SEP) + arguments)
    msg = ((str(len(msg)) + MESSAGE_SEP) + msg)
    length = len(msg)
    msg = encode(msg)
    while (total < length):
        msg = msg[sent:]
        sent = sock.send(msg)
        if (not sent):
            raise socket.error
        total += sent

dataset/ETHPy150Open enthought/envisage/envisage/plugins/remote_editor/communication/util.py send/original