InetAddress of client?

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

InetAddress of client?

Peter Speck
Hi,

I've tried to get the client address using request.remoteAddr(), but  
it fails as
        request.remoteAddr().getByteChunk().getBuffer()
returns null. When running using a debugger, it seems like  
DefaultProcessorTask.remoteAddr is never updated.

The same problem with the client port number.

Is this the wrong methods to call, or is this a bug?

----
    - Peter Speck


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

Reply | Threaded
Open this post in threaded view
|

Re: InetAddress of client?

Jeanfrancois Arcand-2
Hi,

Peter Speck wrote:
> Hi,
>
> I've tried to get the client address using request.remoteAddr(), but it
> fails as
>     request.remoteAddr().getByteChunk().getBuffer()
> returns null. When running using a debugger, it seems like
> DefaultProcessorTask.remoteAddr is never updated.

You need to execute something like the following in you Adapter code:

req.action(ActionCode.ACTION_REQ_HOST_ADDR_ATTRIBUTE,null);

before invoking remoteAddr() as this value is lazily evaluated. Try it
and let me know if it works.

Thanks

-- Jeanfrancois

>
> The same problem with the client port number.
>
> Is this the wrong methods to call, or is this a bug?
>
> ----
>    - Peter Speck
>
>
> ---------------------------------------------------------------------
> 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]

Reply | Threaded
Open this post in threaded view
|

Re: InetAddress of client?

Peter Speck

On 05/07/2007, at 22:37, Jeanfrancois Arcand wrote:

> You need to execute something like the following in you Adapter code:
>
> req.action(ActionCode.ACTION_REQ_HOST_ADDR_ATTRIBUTE,null);
>
> before invoking remoteAddr() as this value is lazily evaluated. Try  
> it and let me know if it works.

Yes, that helped a lot. Thanks!

----
    - Peter Speck


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