Skip to main content

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

Hey Simone!

Thanks for your response. I'm sorry, I don't know which template to follow. If you can tell me where to find it, I can post the question in that format.

The jetty version we are using is 10.0.13. Prior to this, we were using 9.4.22.v20191022, where we were able to see the EndPoint data.
I don't have any reproducer for this, because this is happening in our production servers. I can, however, get you some logs on the onOpened() and onClosed() calls. 
Please let me know how you want to go about this.

Thanks,
Tanya

On Thursday, September 14, 2023 at 12:37:44 PM PDT, Simone Bordet <sbordet@xxxxxxxxxxx> wrote:


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
----
https://urldefense.com/v3/__http://cometd.org__;!!Op6eflyXZCqGR5I!AYV-Byp-9Ux5O2KCAs5mVaQ_a9dopSSn0BJILvY8Omcx4oFW8f-lEpMGxQJQZ7augEf7a9hFW2Sj_iNX5w$
https://urldefense.com/v3/__http://webtide.com__;!!Op6eflyXZCqGR5I!AYV-Byp-9Ux5O2KCAs5mVaQ_a9dopSSn0BJILvY8Omcx4oFW8f-lEpMGxQJQZ7augEf7a9hFW2QWxu8BAQ$
Developer advice, training, services and support
from the Jetty & CometD experts.


Back to the top