mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
start migrating tunConn to the actor model
This commit is contained in:
parent
b582c444f8
commit
4893a07696
3 changed files with 192 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue