sample/basic/service-example.js
function (request) {
      // Extract information from request.  The toString() call converts the
      // payload from a binary Buffer into a string, decoded using UTF-8
      // character encoding.
      console.log('Service received request payload: ' +
        request.payload.toString())
      // Create the response message
      var response = new dxl.Response(request)
      // Populate the response payload
      response.payload = 'pong'
      // Send the response
      client.sendResponse(response)
    }
function (request) {
      // Extract information from request.  The toString() call converts the
      // payload from a binary Buffer into a string, decoded using UTF-8
      // character encoding.
      console.log('Service received request payload: ' +
        request.payload.toString())
      // Create the response message
      var response = new dxl.Response(request)
      // Populate the response payload
      response.payload = 'pong'
      // Send the response
      client.sendResponse(response)
    }
function ( request ) { // Extract information from request.  The toString() call converts the // payload from a binary Buffer into a string, decoded using UTF-8 // character encoding. console . log ( 'Service received request payload: ' + request . payload . toString ( ) ) // Create the response message var response = new dxl . Response ( request ) // Populate the response payload response . payload = 'pong' // Send the response client . sendResponse ( response ) }
Handle the receipt of an incoming service request
Handle the receipt of an incoming service request