Add per-session read/write workers, work in progress, they still unfortunately need to take a mutex for safety

This commit is contained in:
Arceliar 2019-08-03 21:46:18 -05:00
parent a2966291b9
commit df0090e32a
4 changed files with 106 additions and 54 deletions

View file

@ -69,6 +69,7 @@ func (d *Dialer) DialByNodeIDandMask(nodeID, nodeMask *crypto.NodeID) (*Conn, er
defer t.Stop()
select {
case <-conn.session.init:
conn.session.startWorkers(conn.cancel)
return conn, nil
case <-t.C:
conn.Close()