close the multicast socket in test

This commit is contained in:
Shay Banon 2012-01-24 13:10:38 +02:00
parent e0f9f292ec
commit c1a2a5c910
1 changed files with 3 additions and 1 deletions

View File

@ -121,9 +121,10 @@ public class MulticastZenPingTests {
});
zenPingA.start();
MulticastSocket multicastSocket = null;
try {
Loggers.getLogger(MulticastZenPing.class).setLevel("TRACE");
MulticastSocket multicastSocket = new MulticastSocket(54328);
multicastSocket = new MulticastSocket(54328);
multicastSocket.setReceiveBufferSize(2048);
multicastSocket.setSendBufferSize(2048);
multicastSocket.setSoTimeout(60000);
@ -135,6 +136,7 @@ public class MulticastZenPingTests {
Thread.sleep(100);
} finally {
Loggers.getLogger(MulticastZenPing.class).setLevel("INFO");
if (multicastSocket != null) multicastSocket.close();
zenPingA.close();
threadPool.shutdown();
}