mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Move TCP under link.go
This commit is contained in:
parent
ddd1ac4606
commit
ae79246a66
5 changed files with 30 additions and 29 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue