mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-07-06 00:34:08 +00:00
Support multiple TCP listeners
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user