dev@grizzly.java.net

Re: need some help

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 01 Dec 2008 11:57:24 -0500

Salut,

rama wrote:
> dear friends,
>
> i need some help with this piece of code.
>
> public class EulerResAdapter implements Adapter {
>
> public void service(Request req, final Response res) throws Exception {
> _req_.remoteAddr();
> }
>
> //blablabla (other method)
>
> }
>
>
> after adding this adapter
> st = new SelectorThread();
> st.setPort(port);
> st.setMaxThreads(maxThreads);
> st.setAdapter(new EulerResAdapter());
>
> req.remoteAddr throw a nullpointer :(

Can you send the exception. The value, by default, is lazily evaluated
as it cost in term of performance to compute that value. To get the
value. See:

http://grizzly.markmail.org/search/?q=client%20ip#query:client%20ip+page:2+mid:zzxtqufqyicpx22i+state:results


>
>
> btw, i use a method to serve file on this adapter, that work like a charm.
> the only problem is that i don't understand how to get the ip address
> of the remote addrs
>
>
> there is a way to get the remote ip address of a req?

Take a look at the link and let us know.

A+

-- Jeanfrancois



>
> best regards
>