[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjms-developer
Subject:    [openjms-developer] [ openjms-Feature Requests-750870 ] Cannot bind to a specific interface
From:       "SourceForge.net" <noreply () sourceforge ! net>
Date:       2005-05-24 13:18:33
Message-ID: E1DaZIn-0001ex-Ab () sc8-sf-web2 ! sourceforge ! net
[Download RAW message or body]

Feature Requests item #750870, was opened at 2003-06-08 20:27
Message generated for change (Comment added) made by tanderson
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=474139&aid=750870&group_id=54559

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Category: None
Group: None
>Status: Closed
Priority: 5
Submitted By: John Evans (lgas)
Assigned to: Tim Anderson (tanderson)
Summary: Cannot bind to a specific interface

Initial Comment:
I would like to be able to bind to specific interfaces, 
specifically 127.0.0.1, however it appears that this is 
not possible.  I looked briefly for where to make the 
changes and the only place I can find where a 
ServerSocket is even used is in the apache JNDI stuff.  
If someone can point me in the right direction to get me 
started I'll gladly make the changes and submit a patch.

----------------------------------------------------------------------

>Comment By: Tim Anderson (tanderson)
Date: 2005-05-24 23:18

Message:
Logged In: YES 
user_id=557161

Added support for this in CVS.

Each of the following configuration elements in openjms.xml now 
provide a 'bindAll' attribute: TcpConfiguration TcpsConfiguration, 
HttpConfiguration, and HttpsConfiguration.
This can be used to change how the server accepts connections. 
If "true", the server will accept connections on all network 
interfaces. If "false" the server will only accept  connections on 
the host specified by ServerConfiguration.
If unset, it defaults to "true".

The change will be available in the 0.7.7 release.

----------------------------------------------------------------------

Comment By: Tim Anderson (tanderson)
Date: 2003-08-12 12:21

Message:
Logged In: YES 
user_id=557161

What is the status of this request?
I would like to do a release of openjms 0.7.6 in the next 
week, so if you want your changes in, now is the time to 
speak up.

----------------------------------------------------------------------

Comment By: Tim Anderson (tanderson)
Date: 2003-06-21 20:56

Message:
Logged In: YES 
user_id=557161

You could add another property to the config file 
named 'bindAll' or something similar. If true, this result in the 
ServerSocket(port) constructor being called. If false, the 
ServerSocket(port, ... address) constructor would be used. It 
would default to true, to retain existing behaviour.

You'll need to modify 
src/main/org/exolab/jms/config/openjms.xsd to extend the 
config file. It would become an attribute of the 
&lt;ServerConfiguration&gt; element.

----------------------------------------------------------------------

Comment By: John Evans (lgas)
Date: 2003-06-20 20:08

Message:
Logged In: YES 
user_id=137603

I have the changes to openjms working as needed for my 
environment, however I'm trying to figure out how to handle 
it for the general case.  

Right now I use the host attribute of the ServerConfigurartion 
as the interface for JNDI to bind to, and if the server is using 
TCP mode, I use the internalHost attribute of the 
TcpConfiguration if present, otherwise, the host attribute of 
the ServerConfiguration as the interface for the TCP server 
to bind to.  I think this seems like the &quot;right way&quot; to do it, 
however this means that using the default configuration files, 
or any configuration files that existing users don't change 
(from &quot;localhost&quot; to &quot;0.0.0.0&quot;) that the server will suddenly 
only bind to localhost (127.0.0.1) and not all interfaces.  
Obviously the existing configuration files can be changed to 
replace &quot;localhost&quot; with &quot;0.0.0.0&quot;, however this will affect 
existing deployments, so I guess it's up to you how to 
proceed.  

If you like, I can submit my patches as-is, and let you figure 
it out, or if there is another way you'd like it handled I can go 
ahead and make the changes. 

An alternative would be to add seperate attributes specifying 
the interface to bind JNDI and the TCP server to, but it 
seems like this might clutter up the configuration file.

Let me know how you would like to proceed.

----------------------------------------------------------------------

Comment By: Tim Anderson (tanderson)
Date: 2003-06-19 16:00

Message:
Logged In: YES 
user_id=557161

Patches to exolabcore applied, thanks. Will you be submitting 
corresponding patches to openjms?


----------------------------------------------------------------------

Comment By: John Evans (lgas)
Date: 2003-06-19 05:43

Message:
Logged In: YES 
user_id=137603

Here are the patches to allow binding to a specific interface 
in the exolab core libraries.  

----------------------------------------------------------------------

Comment By: Tim Anderson (tanderson)
Date: 2003-06-17 10:45

Message:
Logged In: YES 
user_id=557161

Sure - the sources for exolabcore can be obtained as follows:
cvs -
d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/openjms 
login 
 
cvs -z3 -
d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/openjms 
co exolabcore



----------------------------------------------------------------------

Comment By: John Evans (lgas)
Date: 2003-06-17 02:43

Message:
Logged In: YES 
user_id=137603

It looks like maybe the connections are being created in the 
init() method of the org.exolab.jms.server.mipc.IpcJmsServer 
class through a call to the .createServer(int port) method 
which creates a new org.exolab.jms.server.mipc.IpcJmsServer 
which only has a single interface which just takes the port to 
listen on and the ConnectionNotifier to notify... so if I'm not 
mistaken, all of this stuff would have to be updated to take 
an optional address to bind to.  If the source is available for 
the exolabcore stuff, I'll take a shot at it....

----------------------------------------------------------------------

Comment By: John Evans (lgas)
Date: 2003-06-17 01:44

Message:
Logged In: YES 
user_id=137603

When I leave the host attribute of the ServerConfiguration 
parameter set to &quot;localhost&quot; (as it is by default) or set it 
explicitly to &quot;127.0.0.1&quot; as you tanderson suggested, the 
server binds to all interfaces on the machine (0.0.0.0) and 
not just 127.0.0.1.

I would like to be able to bind to JUST 127.0.0.1 (or the 
address of any other specific interface, instead of 0.0.0.0 
which is the address that maps to all interfaces).

Again, I'd be happy to make the changes but I have not yet 
found the place in the code where the binding is done, so any 
guidance would be helpful.

----------------------------------------------------------------------

Comment By: Tim Anderson (tanderson)
Date: 2003-06-08 23:17

Message:
Logged In: YES 
user_id=557161

I'm not exactly sure what you're trying to do, but you should 
be able to configure the server for 127.0.0.1. E.g,
in openjms.xml:

  &lt;ServerConfiguration host=&quot;127.0.0.1&quot;/&gt;

As for the JNDI code - the part you're referring to isn't used 
by OpenJMS.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=474139&aid=750870&group_id=54559


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
openjms-developer mailing list
openjms-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openjms-developer
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic