Skip to content

Commit

Permalink
add buffer for udp read&write channel
Browse files Browse the repository at this point in the history
  • Loading branch information
bufrr authored and yilunzhang committed Aug 18, 2023
1 parent 2aef8b0 commit e800a74
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ func NewTunaEntry(service Service, serviceInfo ServiceInfo, wallet *nkn.Wallet,
serviceConn: make(map[byte]*net.UDPConn),
clientAddr: cache.New(time.Duration(config.UDPTimeout)*time.Second, time.Second),
}

te.SetServerUDPReadChan(make(chan []byte))
te.SetServerUDPWriteChan(make(chan []byte))

return te, nil
}

Expand Down
4 changes: 2 additions & 2 deletions tuna.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ func NewCommon(
reverseBytesEntryToExit: make(map[string][]uint64),
reverseBytesExitToEntry: make(map[string][]uint64),

udpReadChan: make(chan []byte),
udpWriteChan: make(chan []byte),
udpReadChan: make(chan []byte, 64),
udpWriteChan: make(chan []byte, 64),
}
c.minBalance, err = common.StringToFixed64(minBalance)
if err != nil {
Expand Down

0 comments on commit e800a74

Please sign in to comment.