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
|
@ -232,7 +232,7 @@ func (tun *TunAdapter) readerPacketHandler(ch chan []byte) {
|
|||
if tc != nil {
|
||||
for _, packet := range packets {
|
||||
p := packet // Possibly required because of how range
|
||||
tc.send <- p
|
||||
<-tc.SyncExec(func() { tc._write(p) })
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
@ -242,7 +242,7 @@ func (tun *TunAdapter) readerPacketHandler(ch chan []byte) {
|
|||
}
|
||||
// If we have a connection now, try writing to it
|
||||
if isIn && session != nil {
|
||||
session.send <- bs
|
||||
<-session.SyncExec(func() { session._write(bs) })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue