OpenHome.Net.ControlPoint.Proxies.CpProxyUpnpOrgConnectionManager1.BeginGetProtocolInfo C# (CSharp) Method

BeginGetProtocolInfo() public method

Invoke the action asynchronously
Returns immediately and will run the client-specified callback when the action later completes. Any output arguments can then be retrieved by calling EndGetProtocolInfo().
public BeginGetProtocolInfo ( CallbackAsyncComplete aCallback ) : void
aCallback CallbackAsyncComplete Delegate to run when the action completes. /// This is guaranteed to be run but may indicate an error
return void
        public void BeginGetProtocolInfo(CallbackAsyncComplete aCallback)
        {
            Invocation invocation = iService.Invocation(iActionGetProtocolInfo, aCallback);
            int outIndex = 0;
            invocation.AddOutput(new ArgumentString((ParameterString)iActionGetProtocolInfo.OutputParameter(outIndex++)));
            invocation.AddOutput(new ArgumentString((ParameterString)iActionGetProtocolInfo.OutputParameter(outIndex++)));
            iService.InvokeAction(invocation);
        }

Usage Example

Ejemplo n.º 1
0
        private void GetProtocolInfoComplete(IntPtr aAsyncHandle)
        {
            lock (this)
            {
                if (DateTime.Now >= iActionPollStopTime)
                {
                    return;
                }
                iConnMgr.BeginGetProtocolInfo(GetProtocolInfoComplete);

                try
                {
                    string source;
                    string sink;
                    iConnMgr.EndGetProtocolInfo(aAsyncHandle, out source, out sink);
                    iActionCount++;
                    if (sink == null && iExpectedSink != null)
                    {
                        Console.Write("Expected " + iExpectedSink + "\n...got (null)\n");
                    }
                    else
                    {
                        if (iExpectedSink == null)
                        {
                            iExpectedSink = sink;
                        }
                        else if (sink != iExpectedSink)
                        {
                            Console.Write("Expected " + iExpectedSink + "\n...got " + sink + "\n");
                        }
                    }
                }
                catch (ControlPoint.ProxyError) { }
            }
        }
All Usage Examples Of OpenHome.Net.ControlPoint.Proxies.CpProxyUpnpOrgConnectionManager1::BeginGetProtocolInfo