mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-28 14:50:26 +08:00
init complete
This commit is contained in:
@@ -16,9 +16,17 @@ type Link struct {
|
||||
pipe chan *head.Packet
|
||||
peerip net.IP
|
||||
endpoint *net.UDPAddr
|
||||
allowedips []*net.IPNet
|
||||
hasKeepRuning bool
|
||||
status int
|
||||
}
|
||||
|
||||
const (
|
||||
LINK_STATUS_DOWN = iota
|
||||
LINK_STATUS_HALFUP
|
||||
LINK_STATUS_UP
|
||||
)
|
||||
|
||||
var (
|
||||
connections = make(map[string]*Link)
|
||||
connmapmu sync.RWMutex
|
||||
@@ -38,6 +46,7 @@ func (l *Link) Close() {
|
||||
connmapmu.Lock()
|
||||
delete(connections, l.peerip.String())
|
||||
connmapmu.Unlock()
|
||||
l.status = LINK_STATUS_DOWN
|
||||
}
|
||||
|
||||
func (l *Link) Read() *head.Packet {
|
||||
|
||||
Reference in New Issue
Block a user