Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
org.dartlang.vm.service.internal.WebSocketRequestSink Class Reference
Inheritance diagram for org.dartlang.vm.service.internal.WebSocketRequestSink:
org.dartlang.vm.service.internal.RequestSink

Public Member Functions

 WebSocketRequestSink (WebSocket webSocket)
 
void add (JsonObject json)
 
void close ()
 
void add (JsonObject request)
 
void close ()
 

Detailed Description

An WebSocket based implementation of RequestSink.

Definition at line 24 of file WebSocketRequestSink.java.

Constructor & Destructor Documentation

◆ WebSocketRequestSink()

org.dartlang.vm.service.internal.WebSocketRequestSink.WebSocketRequestSink ( WebSocket  webSocket)
inline

Definition at line 28 of file WebSocketRequestSink.java.

28 {
29 this.webSocket = webSocket;
30 }

Member Function Documentation

◆ add()

void org.dartlang.vm.service.internal.WebSocketRequestSink.add ( JsonObject  request)
inline

Put request into the sink.

Parameters
requestthe request to put, not null.

Implements org.dartlang.vm.service.internal.RequestSink.

Definition at line 33 of file WebSocketRequestSink.java.

33 {
34 String request = json.toString();
35 if (webSocket == null) {
36 Logging.getLogger().logInformation("Dropped: " + request);
37 return;
38 }
39 Logging.getLogger().logInformation("Sent: " + request);
40 try {
41 webSocket.send(request);
42 } catch (WebSocketException e) {
43 Logging.getLogger().logError("Failed to send request: " + request, e);
44 }
45 }

◆ close()

void org.dartlang.vm.service.internal.WebSocketRequestSink.close ( )
inline

Close the communication channel.

Implements org.dartlang.vm.service.internal.RequestSink.

Definition at line 48 of file WebSocketRequestSink.java.

48 {
49 if (webSocket != null) {
50 try {
51 webSocket.close();
52 } catch (WebSocketException e) {
53 Logging.getLogger().logError("Failed to close websocket", e);
54 }
55 webSocket = null;
56 }
57 }

The documentation for this class was generated from the following file: