[Q] GrizzletContainer support for starting a Grizzlet on port 0

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

[Q] GrizzletContainer support for starting a Grizzlet on port 0

ALT Mobile DEV

It seems that if you specify port 0, then:


Enumeration<SelectorThread> t_aSelectorEnumeration =  
SelectorThread.getSelectors() ;
                       
SelectorThread t_contextSelectorThread ;
                       

while (t_aSelectorEnumeration.hasMoreElements()) {
        t_contextSelectorThread = t_aSelectorEnumeration.nextElement() ;
        System.out.println (t_contextSelectorThread.getPort());
}

will report port 0 and not the OS assigned port. How do I support  
specifying port 0?


thanks.


--Zaid

http://altmobile.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Q] GrizzletContainer support for starting a Grizzlet on port 0

Oleksiy Stashok
Hello,

please try selectorThread.getPortLowLevel()

WBR,
Alexey.

ALT Mobile DEV wrote:

>
> It seems that if you specify port 0, then:
>
>
> Enumeration<SelectorThread> t_aSelectorEnumeration =
> SelectorThread.getSelectors() ;
>            
> SelectorThread t_contextSelectorThread ;
>            
>
> while (t_aSelectorEnumeration.hasMoreElements()) {
>     t_contextSelectorThread = t_aSelectorEnumeration.nextElement() ;
>     System.out.println (t_contextSelectorThread.getPort());
> }
>
> will report port 0 and not the OS assigned port. How do I support
> specifying port 0?
>
>
> thanks.
>
>
> --Zaid
>
> http://altmobile.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]