Skip to content

Add SocketAddress to NetworkTypes#58

Open
gjcairo wants to merge 1 commit intomainfrom
socket-address
Open

Add SocketAddress to NetworkTypes#58
gjcairo wants to merge 1 commit intomainfrom
socket-address

Conversation

@gjcairo
Copy link

@gjcairo gjcairo commented Jan 13, 2026

Motivation

We need some concept of a socket (IPv4/IPv6) address.

Solves #41

Modifications

This type already existed in swift-http-server, but we want to centralise all currency types in their own module, so moving that type here.

@gjcairo gjcairo requested a review from FranzBusch January 13, 2026 13:55
@gjcairo gjcairo added the 🆕 semver/minor Adds new public API. label Jan 13, 2026
@guoye-zhang
Copy link
Contributor

Let's pull the IPAddress types from Containerization? https://github.com/apple/containerization/blob/main/Sources/ContainerizationExtras/IPAddress.swift

@guoye-zhang
Copy link
Contributor

SocketAddress is the types of addresses that socket can connect to, and I wonder if that should be a concurrency since it's specific to the socket API. Also port should probably be separate from IP since it's specific to TCP and UDP.

@FranzBusch
Copy link
Member

FranzBusch commented Jan 23, 2026

I think it is okay moving forward with this type for now but we should engage with the maintainer of https://github.com/swift-dns/swift-endpoint/tree/main once we are public.

Also port should probably be separate from IP since it's specific to TCP and UDP.

I agree with this though. Port should only come into play with SocketAddress or an Endpoint type and not IPAddress

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

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants