How to bind StompConnect on all network interfaces

View: New views
2 Messages — Rating Filter:   Alert me  

How to bind StompConnect on all network interfaces

by Alexander L. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

Re: How to bind StompConnect on all network interfaces

by Alexander L. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.