Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Won't Fix
-
1.1.7
-
None
-
None
Description
For some unknown reason, the DefaultSocketSessionConfig class is creating a ServerSocket, and create a connection :
static {
initializeTestAddresses();
boolean success = false;
for (Entry<InetSocketAddress, InetAddress> e : TEST_ADDRESSES.entrySet()) {
success = initializeDefaultSocketParameters(e.getKey(), e.getValue());
if (success)
}
private static void initializeTestAddresses() {
try {
TEST_ADDRESSES.put(new InetSocketAddress(0), InetAddress.getByAddress(new byte[]
));
TEST_ADDRESSES.put(new InetSocketAddress(0), InetAddress.getByAddress(new byte[]
));
} catch (UnknownHostException e)
}
private static boolean initializeDefaultSocketParameters(InetSocketAddress bindAddress, InetAddress connectAddress) {
ServerSocket ss = null;
Socket socket = null;
try
{ ss = new ServerSocket(); ss.bind(bindAddress); socket = new Socket(); socket.connect(new InetSocketAddress(connectAddress, ss.getLocalPort()), 10000); initializeDefaultSocketParameters(socket); return true; }catch (IOException ioe)
{ return false; } finally {
if (socket != null) {
try
catch (IOException e)
{ ExceptionMonitor.getInstance().exceptionCaught(e); }}
if (ss != null) {
try { ss.close(); } catch (IOException e) { ExceptionMonitor.getInstance().exceptionCaught(e); }
}
}
}
The only reason why this code exists is to setup the default values for the socket configuration.
Not only is this bad code, but also a totally wrong thing to do : in many environment, creating sockets this way will lead to breakages (Applet, etc).
It as to be fixed urgently.
Attachments
Attachments
Issue Links
- is depended upon by
-
DIRMINA-628 Windows Firewall security issue when configuring socket
- Closed
- is duplicated by
-
DIRMINA-663 CumulativeProtocolDecoder doDecode performance problem
- Closed
- is related to
-
DIRMINA-437 AccessControlException on 127.0.01 when using Mina in an Applet
- Closed