Added debug option to bind sockets to active network

This commit is contained in:
M66B
2021-09-02 21:31:06 +02:00
parent 0c25724063
commit a2c3f642e0
6 changed files with 51 additions and 5 deletions

View File

@@ -309,8 +309,11 @@ public class SocketFetcher {
prefix + ".usesocketchannels", false)) {
logger.finer("using SocketChannels");
socket = SocketChannel.open().socket();
} else
socket = new Socket();
} else {
SocketFactory f = (SocketFactory) props.get("fairemail.factory");
eu.faircode.email.Log.i("Using socket factory=" + f);
socket = (f == null ? new Socket() : f.createSocket());
}
}
if (to >= 0) {
if (logger.isLoggable(Level.FINEST))
@@ -333,6 +336,7 @@ public class SocketFetcher {
iaddr = InetAddress.getByAddress(server, iaddr.getAddress());
eu.faircode.email.Log.i("Socket connect " + iaddr +
" timeout=" + cto +
" server=" + server +
" reuse=" + socket.getReuseAddress() +
" local=" + socket.getLocalSocketAddress());
logger.finest("connecting...");