Package org.angular.ts.ng
Interface WebTransportConnection
@JsType(isNative=true,
name="ng.WebTransportConnection",
namespace="<global>")
public interface WebTransportConnection
Managed WebTransport connection returned by `$webTransport`. The connection wraps the browser-native `WebTransport` object and keeps its promise/stream model visible while adding small conveniences for sending bytes, text, datagrams, and unidirectional streams.
-
Method Summary
Modifier and TypeMethodDescriptionvoidClose the WebTransport session.elemental2.promise.Promise<Object> Open a reliable bidirectional stream.elemental2.promise.Promise<Void> Resolves or rejects when the managed connection closes permanently.elemental2.promise.Promise<WebTransportConnection> getReady()Resolves after the current native WebTransport session is ready.Current browser-native WebTransport instance.elemental2.promise.Promise<Void> sendDatagram(Object data) Send one unreliable datagram.elemental2.promise.Promise<Void> sendStream(Object data) Send data on a client-opened reliable unidirectional stream.elemental2.promise.Promise<Void> Send UTF-8 text as one unreliable datagram.voidResolves or rejects when the managed connection closes permanently.voidsetReady(elemental2.promise.Promise<WebTransportConnection> ready) Resolves after the current native WebTransport session is ready.voidsetTransport(Object transport) Current browser-native WebTransport instance.
-
Method Details
-
close
Close the WebTransport session.- Parameters:
closeInfo- Value supplied for the closeInfo parameter.
-
createBidirectionalStream
elemental2.promise.Promise<Object> createBidirectionalStream()Open a reliable bidirectional stream.- Returns:
- Method result.
-
getClosed
Resolves or rejects when the managed connection closes permanently. -
getReady
Resolves after the current native WebTransport session is ready. -
getTransport
Current browser-native WebTransport instance. Replaced after reconnects. -
sendDatagram
Send one unreliable datagram.- Parameters:
data- Value supplied for the data parameter.- Returns:
- Method result.
-
sendStream
Send data on a client-opened reliable unidirectional stream.- Parameters:
data- Value supplied for the data parameter.- Returns:
- Method result.
-
sendText
Send UTF-8 text as one unreliable datagram.- Parameters:
data- Value supplied for the data parameter.- Returns:
- Method result.
-
setClosed
Resolves or rejects when the managed connection closes permanently. -
setReady
Resolves after the current native WebTransport session is ready. -
setTransport
Current browser-native WebTransport instance. Replaced after reconnects.
-