This commit is contained in:
MCJack123 2023-10-05 16:40:11 -04:00
parent b7f870efb7
commit b99a2e517a
No known key found for this signature in database
GPG Key ID: 1D99413F734AA894
1 changed files with 8 additions and 1 deletions

View File

@ -27,14 +27,16 @@ public class TWebsocket extends Resource<TWebsocket> implements WebsocketClient
private final IAPIEnvironment environment;
private final URI uri;
private final String address;
private final boolean binary;
private @Nullable WebSocket websocket;
public TWebsocket(ResourceGroup<TWebsocket> limiter, IAPIEnvironment environment, URI uri, String address, HttpHeaders headers, int timeout) {
public TWebsocket(ResourceGroup<TWebsocket> limiter, IAPIEnvironment environment, URI uri, String address, HttpHeaders headers, int timeout, boolean binary) {
super(limiter);
this.environment = environment;
this.uri = uri;
this.address = address;
this.binary = binary;
}
public void connect() {
@ -76,6 +78,11 @@ public void sendBinary(ByteBuffer message) {
websocket.send(array);
}
@Override
public boolean isBinary() {
return binary;
}
@Override
protected void dispose() {
super.dispose();