Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose remote address via DuplexConnection #929

Merged
merged 1 commit into from
Sep 10, 2020

Conversation

rstoyanchev
Copy link
Contributor

Pull request for #735 and #743.

* Return the remote address that this connection is connected to. The returned {@link
* SocketAddress} varies by transport type and should be downcast to obtain more detailed
* information. For TCP and WebSocket, the address type is {@link java.net.InetSocketAddress}. For
* local transport, it is {@link io.rsocket.transport.local.LocalSocketAddress}.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we clarify here that it is null for disconnected connections? Do we want to mark as @nullable?

Copy link
Contributor Author

@rstoyanchev rstoyanchev Sep 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for a disconnected connection, the channel still returns an address. My understanding is it can return null before it is connected but DuplexConnection is typically created after the connection is established.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. I think soo. I guess once the connection is resolved, the address should be available.

Copy link
Member

@OlegDokuka OlegDokuka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to intercept requests and access channel information such as remote address
3 participants