mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Support multiple TCP listeners
This commit is contained in:
parent
ae79246a66
commit
be8db0c120
6 changed files with 110 additions and 74 deletions
|
@ -21,8 +21,9 @@ type link struct {
|
|||
core *Core
|
||||
mutex sync.RWMutex // protects interfaces below
|
||||
interfaces map[linkInfo]*linkInterface
|
||||
awdl awdl // AWDL interface support
|
||||
tcp tcpInterface // TCP interface support
|
||||
handlers map[string]linkListener
|
||||
awdl awdl // AWDL interface support
|
||||
tcp tcp // TCP interface support
|
||||
// TODO timeout (to remove from switch), read from config.ReadTimeout
|
||||
}
|
||||
|
||||
|
@ -34,6 +35,10 @@ type linkInfo struct {
|
|||
remote string // Remote name or address
|
||||
}
|
||||
|
||||
type linkListener interface {
|
||||
init(*link) error
|
||||
}
|
||||
|
||||
type linkInterfaceMsgIO interface {
|
||||
readMsg() ([]byte, error)
|
||||
writeMsg([]byte) (int, error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue