Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] Jetty onClosed InetSocketAddress Retrieval

Hi,

I have a question about some implementation logic we want to build.
We are trying to maintain a record of connections made by an IP, and we want to increment the connection count when a client connects , and decrement the same when they close the connection. For this, we are extending the ConnectionStatistics class, and overriding the onOpened(Connection obj) and onClosed(Connection obj) methods. 
The Connection object allows me to access the Endpoint object, which in turn gives me the InetSocketAddress, and I can get the IP address of the connecting entity. This works fine when the connection is established (when onOpened() is called). 
However, when the connection is closed, and onClosed() is called, it seems that the Endpoint object is null at that point. This is something that was returning non-null values earlier this year, and is returning null now. Because of this, our logic to look up the IP address and decrement the connection count is not working. Is there any way I can get the IP address of the entity on connection close?

Thanks,
Tanya


Back to the top