mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 06:35:07 +03:00
upgrade phony dependency and switch to its new interface
This commit is contained in:
parent
cff1366146
commit
aa30c6cc98
10 changed files with 54 additions and 54 deletions
|
@ -17,7 +17,7 @@ import (
|
|||
const tunConnTimeout = 2 * time.Minute
|
||||
|
||||
type tunConn struct {
|
||||
phony.Actor
|
||||
phony.Inbox
|
||||
tun *TunAdapter
|
||||
conn *yggdrasil.Conn
|
||||
addr address.Address
|
||||
|
@ -198,7 +198,7 @@ func (s *tunConn) _write(bs []byte) (err error) {
|
|||
// No point in wasting resources to send back an error if there was none
|
||||
return
|
||||
}
|
||||
s.EnqueueFrom(s.conn, func() {
|
||||
s.RecvFrom(s.conn, func() {
|
||||
if e, eok := err.(yggdrasil.ConnError); !eok {
|
||||
if e.Closed() {
|
||||
s.tun.log.Debugln(s.conn.String(), "TUN/TAP generic write debug:", err)
|
||||
|
|
|
@ -257,7 +257,7 @@ func (tun *TunAdapter) wrap(conn *yggdrasil.Conn) (c *tunConn, err error) {
|
|||
tun.subnetToConn[s.snet] = &s
|
||||
// Set the read callback and start the timeout goroutine
|
||||
conn.SetReadCallback(func(bs []byte) {
|
||||
s.EnqueueFrom(conn, func() {
|
||||
s.RecvFrom(conn, func() {
|
||||
s._read(bs)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue