I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 6e06d326 authored by zzz's avatar zzz
Browse files

Use ReadLine for SAMHandlerFactory

parent 072e4dc2
No related branches found
No related tags found
No related merge requests found
......@@ -46,14 +46,11 @@ class SAMHandlerFactory {
try {
Socket sock = s.socket();
sock.setSoTimeout(HELLO_TIMEOUT);
sock.setKeepAlive(true);
String line = DataHelper.readLine(sock.getInputStream());
StringBuilder buf = new StringBuilder(128);
ReadLine.readLine(sock, buf, HELLO_TIMEOUT);
String line = buf.toString();
sock.setSoTimeout(0);
if (line == null) {
log.debug("Connection closed by client");
return null;
}
tok = new StringTokenizer(line.trim(), " ");
} catch (SocketTimeoutException e) {
throw new SAMException("Timeout waiting for HELLO VERSION", e);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment