On Mon, May 16, 2011 at 8:33 AM, Anjana Fernando <[email protected]> wrote:

> Hi,
>
> Doesn't that means, that type of a code should be in all the places we open
> a socket? .. is that practical?


If it is implemented as a common util method then it's practical. We still
need to do some work to call the method from different components though.


> .. Also, how about if we provide a simple configuration parameter which
> says, an offset from the base ports, like the default is 0, then you can
> increment it, for example in one server it will be 1, so internally we can
> change the default HTTP/HTTPS ports from 9763/9443 to 9764/9444 and so on.
>

IMO this is not very user friendly. This way user should define the offset
for each and every server. Instead server should pick the port on its own
when the specified port is not available. Only user defined option should be
to turn off this behavior when not necessary.

Thanks,
Hiranya


>
> Cheers,
> Anjana.
>
> On Sun, May 15, 2011 at 10:17 PM, Afkham Azeez <[email protected]> wrote:
>
>> In Tomcat, the following method is used when certain ports need to be
>> used;
>>
>> protected int bind(ServerSocket socket, int portstart, int retries) throws
>> IOException {
>>         InetSocketAddress addr = null;
>>         while ( retries > 0 ) {
>>             try {
>>                 addr = new InetSocketAddress(getBind(), portstart);
>>                 socket.bind(addr);
>>                 setPort(portstart);
>>                 log.info("Receiver Server Socket bound to:"+addr);
>>                 return 0;
>>             }catch ( IOException x) {
>>                 retries--;
>>                 if ( retries <= 0 ) {
>>                     log.info("Unable to bind server socket to:"+addr+"
>> throwing error.");
>>                     throw x;
>>                 }
>>                 portstart++;
>>                 try {Thread.sleep(25);}catch( InterruptedException
>> ti){Thread.interrupted();}
>>                 retries = bind(socket,portstart,retries);
>>             }
>>         }
>>         return retries;
>>     }
>>
>> We can provide such a util method and whoever wants to open ports, can
>> request for a port from that util method.
>>
>>
>> On Fri, May 13, 2011 at 2:20 PM, Hiranya Jayathilaka <[email protected]>wrote:
>>
>>> 1. Change the HTTP/S ports in mgt-transports.xml (2)
>>> 2. Change the HTTP/S ports in axis2.xml (2)
>>> 3. Change the LDAP ports in carbon.xml (2)
>>> 4. Change the Qpid ports in carbon.xml (2)
>>> 5. Change the JMX ports in advanced/jmx.xml (2)
>>>
>>> Total 10 ports to change :(
>>>
>>>
>>> --
>>> Hiranya Jayathilaka
>>> Senior Software Engineer;
>>> WSO2 Inc.;  http://wso2.org
>>> E-mail: [email protected];  Mobile: +94 77 633 3491
>>> Blog: http://techfeast-hiranya.blogspot.com
>>>
>>> _______________________________________________
>>> Carbon-dev mailing list
>>> [email protected]
>>> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>>>
>>>
>>
>>
>> --
>> *Afkham Azeez*
>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> Member; Apache Software Foundation; http://www.apache.org/
>> * <http://www.apache.org/>**
>> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>> *
>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>> *
>> *
>> *Lean . Enterprise . Middleware*
>>
>>
>> _______________________________________________
>> Carbon-dev mailing list
>> [email protected]
>> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>>
>>
>
>
> --
> *Anjana Fernando*
> Senior Software Engineer
> WSO2 Inc. | http://wso2.com
> lean . enterprise . middleware
>
> _______________________________________________
> Carbon-dev mailing list
> [email protected]
> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>
>


-- 
Hiranya Jayathilaka
Senior Software Engineer;
WSO2 Inc.;  http://wso2.org
E-mail: [email protected];  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
_______________________________________________
Carbon-dev mailing list
[email protected]
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to