summaryrefslogtreecommitdiffstats
path: root/src/main/java/de/bwlehrpool
diff options
context:
space:
mode:
authorSimon Rettberg2020-06-18 12:31:29 +0200
committerSimon Rettberg2020-06-18 12:31:29 +0200
commit229e0057a0b73d1e0f93fcad47abcec7370364ea (patch)
treecb9ce0d8f044a30c33072ed2061381d6c6315076 /src/main/java/de/bwlehrpool
parentBase64 encode LoginRPC data (diff)
downloadbwlp-guacamole-ext-229e0057a0b73d1e0f93fcad47abcec7370364ea.tar.gz
bwlp-guacamole-ext-229e0057a0b73d1e0f93fcad47abcec7370364ea.tar.xz
bwlp-guacamole-ext-229e0057a0b73d1e0f93fcad47abcec7370364ea.zip
Apply socket timeouts for LoginRPC
Diffstat (limited to 'src/main/java/de/bwlehrpool')
-rw-r--r--src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java b/src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java
index 664bc3f..b498072 100644
--- a/src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java
+++ b/src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java
@@ -1,6 +1,7 @@
package de.bwlehrpool.bwlp_guac;
import java.io.*;
+import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
@@ -207,7 +208,9 @@ public class AvailableClient implements Cloneable {
try {
LOGGER.info("Logging in user " + username + " on client " + this);
- Socket socket = new Socket(this.clientip, 7551); // TODO Port?
+ Socket socket = new Socket(); // TODO Port?
+ socket.connect(new InetSocketAddress(this.clientip, 7551), 1100);
+ socket.setSoTimeout(1000);
OutputStream output = socket.getOutputStream();
int version = 1;