/// <summary>
        /// Request a cancel connect
        /// </summary>
        public async Task <bool> CancelConnect(string ownerUri)
        {
            var cancelParams = new CancelConnectParams();

            cancelParams.OwnerUri = ownerUri;

            return(await Driver.SendRequest(CancelConnectRequest.Type, cancelParams));
        }
예제 #2
0
        /// <summary>
        /// Handle cancel connect requests
        /// </summary>
        protected async Task HandleCancelConnectRequest(
            CancelConnectParams cancelParams,
            RequestContext <bool> requestContext)
        {
            Logger.Write(LogLevel.Verbose, "HandleCancelConnectRequest");

            try
            {
                bool result = CancelConnect(cancelParams);
                await requestContext.SendResult(result);
            }
            catch (Exception ex)
            {
                await requestContext.SendError(ex.ToString());
            }
        }