mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-07-06 01:44:06 +00:00
Move TCP under link.go
This commit is contained in:
@ -8,6 +8,7 @@ import (
|
||||
"net"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
//"sync/atomic"
|
||||
"time"
|
||||
|
||||
@ -20,7 +21,8 @@ type link struct {
|
||||
core *Core
|
||||
mutex sync.RWMutex // protects interfaces below
|
||||
interfaces map[linkInfo]*linkInterface
|
||||
awdl awdl // AWDL interface support
|
||||
awdl awdl // AWDL interface support
|
||||
tcp tcpInterface // TCP interface support
|
||||
// TODO timeout (to remove from switch), read from config.ReadTimeout
|
||||
}
|
||||
|
||||
@ -58,6 +60,11 @@ func (l *link) init(c *Core) error {
|
||||
l.interfaces = make(map[linkInfo]*linkInterface)
|
||||
l.mutex.Unlock()
|
||||
|
||||
if err := l.tcp.init(l); err != nil {
|
||||
c.log.Errorln("Failed to start TCP interface")
|
||||
return err
|
||||
}
|
||||
|
||||
if err := l.awdl.init(l); err != nil {
|
||||
l.core.log.Errorln("Failed to start AWDL interface")
|
||||
return err
|
||||
|
Reference in New Issue
Block a user