Udostępnij za pośrednictwem


ControlChannelTrigger.UsingTransport(Object) Method

Definition

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.

public:
 virtual void UsingTransport(Platform::Object ^ transport) = UsingTransport;
void UsingTransport(IInspectable const& transport);
public void UsingTransport(object transport);
function usingTransport(transport)
Public Sub UsingTransport (transport As Object)

Parameters

transport
Object

Platform::Object

IInspectable

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 HttpClient in the Windows.Web.Http namespace, the UsingTransport method needs to be called with the initialized HttpClient instance before any of the GET, PUT, POST, SEND, OR DELETE request methods on the HttpClient or related classes are invoked.

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 , the UsingTransport method needs to be called with the initialized instance before any of the GET, PUT, POST, SEND, OR DELETE request methods on the or related classes are invoked.

Applies to