mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-11 12:10:26 +08:00
添加环回连接
This commit is contained in:
@@ -23,6 +23,8 @@ type Me struct {
|
|||||||
subnet net.IPNet
|
subnet net.IPNet
|
||||||
// 本机 endpoint
|
// 本机 endpoint
|
||||||
myend *net.UDPAddr
|
myend *net.UDPAddr
|
||||||
|
// 本机环回 link
|
||||||
|
loop *Link
|
||||||
// 本机活跃的所有连接
|
// 本机活跃的所有连接
|
||||||
connections map[string]*Link
|
connections map[string]*Link
|
||||||
// 读写同步锁
|
// 读写同步锁
|
||||||
@@ -55,6 +57,7 @@ func NewMe(privateKey *[32]byte, myipwithmask string, myEndpoint string, nopipei
|
|||||||
if nopipeinlink {
|
if nopipeinlink {
|
||||||
m.pipe = make(chan *head.Packet, 32)
|
m.pipe = make(chan *head.Packet, 32)
|
||||||
}
|
}
|
||||||
|
m.loop = m.AddPeer(m.me.String(), nil, "127.0.0.1:56789", []string{myipwithmask}, 0, false, nopipeinlink)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user