Close the client socket that we used when trying to check that we can use a given port in the canUseAsPort method.
| | |
| | | * socket there is already someone listening to the port (is the case |
| | | * of products as Sun DS 6.0). |
| | | */ |
| | | Socket s = null; |
| | | try |
| | | { |
| | | new Socket().connect(socketAddress, 1000); |
| | | s = new Socket(); |
| | | s.connect(socketAddress, 1000); |
| | | canUseAsPort = false; |
| | | |
| | | } catch (IOException ioe) |
| | | } catch (Throwable t) |
| | | { |
| | | } |
| | | finally |
| | | { |
| | | if (s != null) |
| | | { |
| | | try |
| | | { |
| | | s.close(); |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } catch (IOException ex) |
| | | { |