Split up metalistener, fix deadlock in accept routine, I think

This commit is contained in:
eyedeekay
2025-05-26 17:05:48 -04:00
parent d3aa11b9d2
commit 37c4fdbba9
5 changed files with 190 additions and 175 deletions

31
metaaddr.go Normal file
View File

@ -0,0 +1,31 @@
package meta
import "net"
// MetaAddr implements the net.Addr interface for a meta listener.
type MetaAddr struct {
addresses []net.Addr
}
// Network returns the name of the network.
func (ma *MetaAddr) Network() string {
return "meta"
}
// String returns a string representation of all managed addresses.
func (ma *MetaAddr) String() string {
if len(ma.addresses) == 0 {
return "meta(empty)"
}
result := "meta("
for i, addr := range ma.addresses {
if i > 0 {
result += ", "
}
result += addr.String()
}
result += ")"
return result
}