mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-23 15:45:49 +00:00
Set IRC discovery so timeout. Resolves issue 269.
This commit is contained in:
parent
590d47f273
commit
7108751d3c
@ -97,11 +97,12 @@ public class IrcDiscovery implements PeerDiscovery {
|
||||
int ipCursor = ipCursorStart;
|
||||
do {
|
||||
connection = new Socket();
|
||||
int timeoutMsec = (int) TimeUnit.MILLISECONDS.convert(timeoutValue, timeoutUnit);
|
||||
connection.setSoTimeout(timeoutMsec);
|
||||
try {
|
||||
InetAddress ip = ips[ipCursor];
|
||||
long timeoutMsec = TimeUnit.MILLISECONDS.convert(timeoutValue, timeoutUnit);
|
||||
log.info("Connecting to IRC with " + ip);
|
||||
connection.connect(new InetSocketAddress(ip, port), (int)timeoutMsec);
|
||||
connection.connect(new InetSocketAddress(ip, port), timeoutMsec);
|
||||
} catch (SocketTimeoutException e) {
|
||||
connection = null;
|
||||
} catch (IOException e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user