Set socket timeout to 3 minutes in the DCC receiver, too.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 5 Aug 2013 17:51:31 +0000 (19:51 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 8 Aug 2013 00:15:59 +0000 (02:15 +0200)
src/main/java/net/pterodactylus/irc/DccReceiver.java

index ed59c69..abb018c 100644 (file)
@@ -176,6 +176,7 @@ public class DccReceiver extends AbstractExecutionThreadService {
                Socket socket = null;
                try {
                        socket = new Socket(inetAddress, port);
+                       socket.setSoTimeout((int) TimeUnit.MINUTES.toMillis(3));
                        InputStream socketInputStream = socket.getInputStream();
                        inputStream = new BandwidthCountingInputStream(socketInputStream, 5, TimeUnit.SECONDS);
                        byte[] buffer = new byte[65536];