Skip to main content

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

Hi,

On Thu, Sep 14, 2023 at 8:30 PM Tanya via jetty-dev
<jetty-dev@xxxxxxxxxxx> wrote:
>
> 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?

Please file an issue with exact Jetty versions, etc. (follow the issue
template).
The EndPoint should not be null.
If you have a reproducer that we can try, please attach it to the issue.

Thanks!

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.


Back to the top