lib/json-rpc2-server.js
function (method, result) {

      // result should not be undefined
      if (result === undefined) {
        console.warn('JSON-RPC2 response from method ' + methodName + ' should return a result. (JSON-RPC2 spec)')
        result = ''
      }

      var rpcMessage = {
        jsonrpc: '2.0',
        result: result,
        id: id
      }

      callback(rpcMessage)
      responseHasBeenSent = true

    }
function (method, result) {

      // result should not be undefined
      if (result === undefined) {
        console.warn('JSON-RPC2 response from method ' + methodName + ' should return a result. (JSON-RPC2 spec)')
        result = ''
      }

      var rpcMessage = {
        jsonrpc: '2.0',
        result: result,
        id: id
      }

      callback(rpcMessage)
      responseHasBeenSent = true

    }
function ( method , result ) { // result should not be undefined if ( result === undefined ) { console . warn ( 'JSON-RPC2 response from method ' + methodName + ' should return a result. (JSON-RPC2 spec)' ) result = '' } var rpcMessage = { jsonrpc : '2.0' , result : result , id : id } callback ( rpcMessage ) responseHasBeenSent = true }
create send message method
create send message method