lib/actions/server/send.js
function send(id) {
        if (msg.ack) { server._rememberAck(msg.ack, ws.broker_uuid); }

        var destWs = server.id2ws[id];
        if (destWs) {
            if (destWs.readyState === WebSocket.OPEN) {
                destWs.send(JSON.stringify({
                    action: 'message',
                    message: msg.message,
                    ack: msg.ack,
                    from: server.ws2id[ws.broker_uuid]
                }));
            } else {
                err = new Error('Unable to send message. Client "'+id+'" disconnected');
                server.emit('error', err);
            }
        } else {
            server.emit('warn', new Error('Unable to send message. Client "'+id+'" unknown'));
        }
    }
function send(id) {
        if (msg.ack) { server._rememberAck(msg.ack, ws.broker_uuid); }

        var destWs = server.id2ws[id];
        if (destWs) {
            if (destWs.readyState === WebSocket.OPEN) {
                destWs.send(JSON.stringify({
                    action: 'message',
                    message: msg.message,
                    ack: msg.ack,
                    from: server.ws2id[ws.broker_uuid]
                }));
            } else {
                err = new Error('Unable to send message. Client "'+id+'" disconnected');
                server.emit('error', err);
            }
        } else {
            server.emit('warn', new Error('Unable to send message. Client "'+id+'" unknown'));
        }
    }
function send ( id ) { if ( msg . ack ) { server . _rememberAck ( msg . ack , ws . broker_uuid ) ; } var destWs = server . id2ws [ id ] ; if ( destWs ) { if ( destWs . readyState === WebSocket . OPEN ) { destWs . send ( JSON . stringify ( { action : 'message' , message : msg . message , ack : msg . ack , from : server . ws2id [ ws . broker_uuid ] } ) ) ; } else { err = new Error ( 'Unable to send message. Client "' + id + '" disconnected' ) ; server . emit ( 'error' , err ) ; } } else { server . emit ( 'warn' , new Error ( 'Unable to send message. Client "' + id + '" unknown' ) ) ; } }
Re-wraps incoming 'send' message into a 'message' message to the specified destination
@param id
Re - wraps incoming send message into a message message to the specified destination