mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
when a link becomes idle and packet are buffered that the link could send, send at least 65535 bytes worth instead of 1 packet, this reduces syscall overhead when small packets are sent through the network
This commit is contained in:
parent
62337bcd64
commit
8af1a7086c
2 changed files with 41 additions and 29 deletions
|
@ -556,8 +556,10 @@ func DEBUG_simLinkPeers(p, q *peer) {
|
|||
goWorkers := func(source, dest *peer) {
|
||||
source.linkOut = make(chan []byte, 1)
|
||||
send := make(chan []byte, 1)
|
||||
source.out = func(bs []byte) {
|
||||
send <- bs
|
||||
source.out = func(bss [][]byte) {
|
||||
for _, bs := range bss {
|
||||
send <- bs
|
||||
}
|
||||
}
|
||||
go source.linkLoop()
|
||||
go func() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue