How to bind StompConnect on all network interfaces

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to bind StompConnect on all network interfaces

Alexander L.
Hello,

It seems that StompConnect API does not allow binding on all network interfaces (just like JBoss could with option -b 0.0.0.0)
See API at http://stomp.codehaus.org/maven/apidocs/org/codehaus/stomp/jms/StompConnect.html
- it has only setUri/setLocation methods which take the host name string.

Being provided, the host name is used in stompConnect source code to build InetAddress from it and further create server socket.

Does it mean that if I need to bind to all interfaces then I have to iterate over them and bind to each corresponding InetAddress?

This is my current solution by the way.

Thanks,
Alex.
Reply | Threaded
Open this post in threaded view
|

Re: How to bind StompConnect on all network interfaces

Alexander L.
The solution is pretty much simpler...
Code like

StompConnect connect = new StompConnect();
connect.setUri("tcp://0.0.0.0:61616");

is all what I needed to bind port 61616 to all interfaces.