当前位置: 首页>>代码示例>>C#>>正文


C# ProcessRequestAsyncResult.BeginProcessRequest方法代码示例

本文整理汇总了C#中ProcessRequestAsyncResult.BeginProcessRequest方法的典型用法代码示例。如果您正苦于以下问题:C# ProcessRequestAsyncResult.BeginProcessRequest方法的具体用法?C# ProcessRequestAsyncResult.BeginProcessRequest怎么用?C# ProcessRequestAsyncResult.BeginProcessRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProcessRequestAsyncResult的用法示例。


在下文中一共展示了ProcessRequestAsyncResult.BeginProcessRequest方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BeginProcessRequest

        /// <summary>
        /// Begins processing a request received via a binary encoded channel.
        /// </summary>
        /// <param name="channeId">A unique identifier for the secure channel which is the source of the request.</param>
        /// <param name="endpointDescription">The description of the endpoint which the secure channel is using.</param>
        /// <param name="request">The incoming request.</param>
        /// <param name="callback">The callback.</param>
        /// <param name="callbackData">The callback data.</param>
        /// <returns>
        /// The result which must be passed to the EndProcessRequest method.
        /// </returns>
        /// <seealso cref="EndProcessRequest"/>
        /// <seealso cref="ITransportListener"/>
        public IAsyncResult BeginProcessRequest(
            string channeId,
            EndpointDescription endpointDescription,
            IServiceRequest request,
            AsyncCallback callback,
            object callbackData)
        {
            if (channeId == null) throw new ArgumentNullException("channeId");
            if (request == null) throw new ArgumentNullException("request");

            // create operation.
            ProcessRequestAsyncResult result = new ProcessRequestAsyncResult(this, callback, callbackData, 0);

            SecureChannelContext context = new SecureChannelContext(
                channeId,
                endpointDescription,
                RequestEncoding.Binary);

            // begin invoke service.
            return result.BeginProcessRequest(context, request);
        }
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:34,代码来源:EndpointBase.cs

示例2: BeginDeleteReferences

        /// <summary>
        /// Asynchronously calls the DeleteReferences service.
        /// </summary>
        public virtual IAsyncResult BeginDeleteReferences(DeleteReferencesMessage message, AsyncCallback callback, object callbackData)
        {
            try
            {
                // check for bad data.
                if (message == null) throw new ArgumentNullException("message");

                // set the request context.
                SetRequestContext(RequestEncoding.Xml);

                // create handler.
                ProcessRequestAsyncResult result = new ProcessRequestAsyncResult(this, callback, callbackData, 0);
                return result.BeginProcessRequest(SecureChannelContext.Current, message.DeleteReferencesRequest);
            }
            catch (Exception e)
            {
                throw CreateSoapFault(message.DeleteReferencesRequest, e);
            }
        }
开发者ID:zryska,项目名称:UA-.NET,代码行数:22,代码来源:Opc.Ua.Endpoints.cs

示例3: BeginInvokeService

        /// <summary>
        /// Dispatches an incoming binary encoded request.
        /// </summary>
        public virtual IAsyncResult BeginInvokeService(InvokeServiceMessage message, AsyncCallback callack, object callbackData)
        {
            try
            {
                // check for bad data.
                if (message == null)
                {
                    throw new ServiceResultException(StatusCodes.BadInvalidArgument);
                }
                
                // set the request context.
                SetRequestContext(RequestEncoding.Binary);

                // create handler.
                ProcessRequestAsyncResult result = new ProcessRequestAsyncResult(this, callack, callbackData, 0);
                return result.BeginProcessRequest(SecureChannelContext.Current, message.InvokeServiceRequest);
            }
            catch (Exception e)
            {
                throw CreateSoapFault(null, e);
            }
        }
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:25,代码来源:EndpointBase.cs

示例4: BeginCancel

        /// <summary>
        /// Asynchronously calls the Cancel service.
        /// </summary>
        public virtual IAsyncResult BeginCancel(CancelMessage message, AsyncCallback callback, object callbackData)
        {
            try
            {
                // OnRequestReceived(message.CancelRequest);

                // check for bad data.
                if (message == null) throw new ArgumentNullException("message");

                // set the request context.
                SetRequestContext(RequestEncoding.Xml);

                // create handler.
                ProcessRequestAsyncResult result = new ProcessRequestAsyncResult(this, callback, callbackData, 0);
                return result.BeginProcessRequest(SecureChannelContext.Current, message.CancelRequest);
            }
            catch (Exception e)
            {
                Exception fault = CreateSoapFault(message.CancelRequest, e);
                // OnResponseFaultSent(fault);
                throw fault;
            }
        }
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:26,代码来源:Opc.Ua.Endpoints.cs


注:本文中的ProcessRequestAsyncResult.BeginProcessRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。