Adds a TCP connect timeout when creating ICE connectivity check list.

This commit is contained in:
seb 2011-09-12 09:52:20 +00:00
parent f8cb1a05b2
commit 609929087d

View File

@ -383,9 +383,15 @@ public class IceMediaStream
try try
{ {
Socket sock = new MultiplexingSocket(); Socket sock = new MultiplexingSocket();
int timeout = sock.getSoTimeout();
sock.setSoTimeout(1000);
sock.connect(new InetSocketAddress( sock.connect(new InetSocketAddress(
remoteCnd.getTransportAddress().getAddress(), remoteCnd.getTransportAddress().getAddress(),
remoteCnd.getTransportAddress().getPort())); remoteCnd.getTransportAddress().getPort()),
1000);
sock.setSoTimeout(timeout);
LocalCandidate tmp = LocalCandidate tmp =
new HostCandidate(new IceTcpSocketWrapper(sock), new HostCandidate(new IceTcpSocketWrapper(sock),
component); component);
@ -394,6 +400,8 @@ public class IceMediaStream
} }
catch (IOException e) catch (IOException e)
{ {
logger.info("Failed to TCP connect to " +
remoteCnd.getTransportAddress());
continue; continue;
} }
} }