ControlChannelTrigger.UsingTransport method

Applies to Windows only

Sets the transport connection to be used by a control channel trigger by class elements in the Windows.Networking.Sockets and related namespaces.

Note  The ControlChannelTrigger class is not supported on Windows Phone.

Syntax


public void UsingTransport(
  object transport
)

Parameters

transport

Type: System.Object [.NET] | Platform::Object [C++]

The instance of the network class that represents the network transport.

Remarks

The UsingTransport method indicates to the system the transport connection to be used by the ControlChannelTrigger .

An app must call the UsingTransport method after the transport object (a StreamSocket instance, for example) has been created, but before a network connection is established.

For a StreamSocket, the constructor for the StreamSocket would first be called to create the transport object. Then the returned StreamSocket instance would be passed to the UsingTransport method as the transport parameter. Only then can one of the StreamSocket.ConnectAsync methods be called to establish the network connection.

For IXMLHTTPRequest2 interface, the HTTP request must be opened first using the Open method and passed to the UsingTransport method. Then the Send method on the IXMLHTTPRequest2 object can be invoked to send the HTTP request.

For System.Net.Http.HttpClient, the UsingTransport method needs to be called with initialized System.Net.Http.HttpClient instance before any of the GET, PUT, POST, SEND, OR DELETE request methods on the System.Net.Http.HttpClient or related class are invoked.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.winmd

DLL

Windows.Networking.Sockets.Pushenabledapplication.dll

See also

Other resources
How to set background connectivity options
Reference
ControlChannelTrigger
IXMLHTTPRequest2
StreamSocket
System.Net.Http.HttpClient

 

 

Show:
© 2014 Microsoft