[FIX] Request поддерживает возможность перехода на WebSockets

This commit is contained in:
Gravit 2019-02-10 15:51:20 +07:00
parent 7f062e720a
commit c1711d39d3
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -57,7 +57,8 @@ protected final void readError(HInput input) throws IOException {
public R request() throws Exception {
if (!started.compareAndSet(false, true))
throw new IllegalStateException("Request already started");
R wsResult = requestWebSockets();
if(wsResult != null) return wsResult;
// Make request to LaunchServer
try (Socket socket = IOHelper.newSocket()) {
socket.connect(IOHelper.resolve(config.address));
@ -68,7 +69,10 @@ public R request() throws Exception {
}
}
}
protected R requestWebSockets() throws Exception
{
return null;
}
@LauncherAPI
protected abstract R requestDo(HInput input, HOutput output) throws Exception;