users@grizzly.java.net

Re: Get client IP address in ProtocolFilter

From: John ROM <snake-john_at_gmx.de>
Date: Mon, 08 Sep 2008 10:01:34 +0200

>
> Can i get client IP address in protocol filter by using Grizzly framework
> or i have to use NIO?
try
 public boolean execute(Context ctx) throws IOException {
            Socket s=((SocketChannel)ctx.getSelectionKey().channel()).socket();
            System.out.println("Client Address :"+s.getInetAddress());
            System.out.println("Client port :"+s.getPort());
        ..
        ..
 }
 

-- 
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196