diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2023-03-08 22:43:26 +0100 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2023-11-12 17:40:45 +0100 |
commit | d2fdb1697dfcd67540553a2933daa7f63da20d0d (patch) | |
tree | 60c67bd7a0c7e36ed9932ecd001d5cb5cfc3296e /src/main/java/com/lumaserv/bgp/BGPSession.java | |
parent | 0ebe3fda88f69572f9a8c829a0d8e3b5a76b4238 (diff) |
Use socketfactory and allow caller supplied serversocket
To allow using TrafficStats to tag sockets on Android.
Diffstat (limited to 'src/main/java/com/lumaserv/bgp/BGPSession.java')
-rw-r--r-- | src/main/java/com/lumaserv/bgp/BGPSession.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/lumaserv/bgp/BGPSession.java b/src/main/java/com/lumaserv/bgp/BGPSession.java index dd2b7ff..bd40c13 100644 --- a/src/main/java/com/lumaserv/bgp/BGPSession.java +++ b/src/main/java/com/lumaserv/bgp/BGPSession.java @@ -204,17 +204,17 @@ System.out.println("Sent open"); if (socket == null) { while (true) { try { - System.out.println("Outgoing"); - socket = new Socket(); - socket.connect(new InetSocketAddress(host, port)); + System.out.println("Outgoing: " + host + ":" + port); + socket = configuration.getSocketFactory().createSocket(host, port); break; } catch(IOException ex) { + System.out.println("Exception: " + ex); if (closed) { throw new IOException("Closed", ex); } } } - System.out.println("Outgoing accepted"); + System.out.println("Outgoing accepted: " + socket.isConnected()); inputStream = socket.getInputStream(); outputStream = socket.getOutputStream(); fsm.getCurrentState().tcpCRAcked(); |