mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-07-07 01:04:07 +00:00
start migrating tunConn to the actor model
This commit is contained in:
@ -257,8 +257,13 @@ func (tun *TunAdapter) wrap(conn *yggdrasil.Conn) (c *tunConn, err error) {
|
||||
tun.addrToConn[s.addr] = &s
|
||||
tun.subnetToConn[s.snet] = &s
|
||||
// Start the connection goroutines
|
||||
go s.reader()
|
||||
go s.writer()
|
||||
conn.SetReadCallback(func(bs []byte) {
|
||||
s.EnqueueFrom(conn, func() {
|
||||
s._read(bs)
|
||||
})
|
||||
})
|
||||
//go s.reader()
|
||||
//go s.writer()
|
||||
go s.checkForTimeouts()
|
||||
// Return
|
||||
return c, err
|
||||
|
Reference in New Issue
Block a user