1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-28 14:50:26 +08:00

feat(p2p): add ip

This commit is contained in:
源文雨
2024-07-18 02:01:44 +09:00
parent cb2fe9bd21
commit 28c388aca9
11 changed files with 200 additions and 24 deletions

View File

@@ -6,6 +6,7 @@ import (
"time"
"github.com/fumiama/WireGold/gold/p2p"
"github.com/fumiama/WireGold/helper"
)
type Config struct {
@@ -38,8 +39,9 @@ func newEndpoint(endpoint string, configs ...any) (*EndPoint, error) {
}
func init() {
_, hasexist := p2p.Register("tcp", NewEndpoint)
name := helper.FolderName()
_, hasexist := p2p.Register(name, NewEndpoint)
if hasexist {
panic("network tcp has been registered")
panic("network " + name + " has been registered")
}
}