Skip to content

Unify TCP and UnixSocket APIs #3563

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

Open
wants to merge 48 commits into
base: main
Choose a base branch
from
Open

Unify TCP and UnixSocket APIs #3563

wants to merge 48 commits into from

Conversation

mpilquist
Copy link
Member

@mpilquist mpilquist commented Apr 8, 2025

Fixes #3560

This PR revamps fs2.io.net in a number of significant ways:

  • Unifies support for IP and Unix sockets in to a single set of operations -- connect for clients and bind for servers, both taking the new com.comcast.ip4s.GenSocketAddress type, which is a supertype of SocketAddress[Host] and UnixSocketAddress
  • Resultantly adds support for socket options on unix sockets
  • Deprecates SocketGroup - there has never really been a great reason to manage explicit thread pools / async socket groups & the API was JVM only. With the new polling system, there's even less of a reason to ever use the explicitly managed socket groups.
  • Deprecates UnixSockets as there's no utility provided that's not also provided by Network now
  • Deprecates client, server, serverResource in favor of connect, bindAndAccept, bind
  • Introduces ServerSocket, which provides the bound address of the server socket, access to options, and a stream of client sockets.
  • Introduces SocketInfo as a supertype of Socket and ServerSocket.
  • Introduces address: GenSocketAddress on SocketInfo and peerAddress: GenSocketAddress on Socket, replacing localAddress and remoteAddress (each of type F[SocketAddress[IpAddress]].
  • Deprecating isOpen on Socket which is a vestige from when there was a close method.

@mpilquist mpilquist marked this pull request as ready for review April 22, 2025 12:07
@armanbilge armanbilge self-requested a review April 23, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve unix sockets support
2 participants