+11
-1
lines changedFilter options
+11
-1
lines changed Original file line number Diff line number Diff line change
@@ -123,10 +123,18 @@ public WebSocket openSocket(HttpRequest request, WebSocket.Listener listener) {
123
123
client.newWebSocketBuilder().buildAsync(
124
124
uri,
125
125
new java.net.http.WebSocket.Listener() {
126
+
final StringBuilder builder = new StringBuilder();
126
127
127
128
@Override
128
129
public CompletionStage<?> onText(java.net.http.WebSocket webSocket, CharSequence data, boolean last) {
129
-
listener.onText(data);
130
+
builder.append(data);
131
+
132
+
if (last) {
133
+
listener.onText(builder.toString());
134
+
builder.setLength(0);
135
+
}
136
+
137
+
webSocket.request(1);
130
138
return null;
131
139
}
132
140
@@ -136,6 +144,7 @@ public CompletionStage<?> onBinary(java.net.http.WebSocket webSocket, ByteBuffer
136
144
data.get(ary, 0, ary.length);
137
145
138
146
listener.onBinary(ary);
147
+
webSocket.request(1);
139
148
return null;
140
149
}
141
150
@@ -148,6 +157,7 @@ public CompletionStage<?> onClose(java.net.http.WebSocket webSocket, int statusC
148
157
@Override
149
158
public void onError(java.net.http.WebSocket webSocket, Throwable error) {
150
159
listener.onError(error);
160
+
webSocket.request(1);
151
161
}
152
162
});
153
163
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4