mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-28 06:40:26 +08:00
feat(p2p): add ip
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"net/netip"
|
||||
|
||||
"github.com/fumiama/WireGold/gold/p2p"
|
||||
"github.com/fumiama/WireGold/helper"
|
||||
)
|
||||
|
||||
func NewEndpoint(endpoint string, _ ...any) (p2p.EndPoint, error) {
|
||||
@@ -16,8 +17,9 @@ func NewEndpoint(endpoint string, _ ...any) (p2p.EndPoint, error) {
|
||||
}
|
||||
|
||||
func init() {
|
||||
_, hasexist := p2p.Register("udp", NewEndpoint)
|
||||
name := helper.FolderName()
|
||||
_, hasexist := p2p.Register(name, NewEndpoint)
|
||||
if hasexist {
|
||||
panic("network udp has been registered")
|
||||
panic("network " + name + " has been registered")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user