Samsung Electronics logo

Closing the Service Connection



Learning how to close the service connection with a remote peer agent is a basic SAP management skill:

  1. To close the service connection with remote peer agent, use the close() method:

    /* Assume SAAgent object has been obtained by using requestSAAgent() method */
    var callback = 
    {
       onrequest: function(peerAgent){},
       onconnect: function(socket)
       {
          if (socket.peerAgent.appName != "expected_appName") 
          {
             socket.close();
          }
       }
    }
    
    SAAgent.setServiceConnectionListener(callback);