users@grizzly.java.net

Re: InetAddress of client?

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Thu, 05 Jul 2007 16:37:02 -0400

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: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>