Le 09/08/16 à 13:13, David Turny a écrit :
> Hi,
>
> I would like to write an interceptor that do things based on the
> client IP address.
> Unfortunately I couldn't get the client IP.

Something like :

        IoSession ioSession = bindContext.getIoSession();
        SocketAddress address = ioSession.getRemoteAddress();


The thing is that until the Bind operation is completed, we don't have a
CoreSession instance (it's created by the Bind operation), so we can't
feed it with IoSession, so you have to get it directly.

For any other operation, something like :

        SocketAddress address =
searchContext.getSession().getClientAddress();

will work.

Reply via email to