Reputation: 847
I am getting :
java.io.IOException: Failed to bind to server socket: nio://localhost:62626 due to: java.net.BindException: Address already in use
My code :
DSMBrokerService broker = new SslBrokerService();
broker.addConnector("nio://localhost:62626");
broker.start();
broker.waitUntilStarted();
broker.stop();
broker.waitUntilStopped();
... (Do stuff)...
DSMBrokerService broker = new SslBrokerService();
broker.addConnector("nio://localhost:62626"); <- Exception
broker.start();
broker.waitUntilStarted()
Why does broker.stop() not unbind the Address ?
Upvotes: 2
Views: 551
Reputation: 22279
Stopping the broker does not remove the connector. When you restart it again it fires up two connectors on that port.
Upvotes: 1