mirror of
https://github.com/soypat/lneto.git
synced 2026-08-24 16:39:07 +00:00
Berkeley rework (#62)
* begin reworking berkeley stack and add example * thread mock client logic * fix mock stack in example not encapsulating when data available
This commit is contained in:
@@ -30,6 +30,8 @@ import (
|
||||
"github.com/soypat/lneto/x/xnet"
|
||||
)
|
||||
|
||||
const pollTime = 5 * time.Millisecond
|
||||
|
||||
var softRand = time.Now().Unix()
|
||||
|
||||
func main() {
|
||||
@@ -180,7 +182,7 @@ func run() (err error) {
|
||||
|
||||
clear(buf[:nwrite])
|
||||
// Poll before read if interface supports it, to avoid blocking indefinitely.
|
||||
ready, err := tryPoll(iface, 5*time.Millisecond)
|
||||
ready, err := tryPoll(iface, pollTime)
|
||||
if err != nil {
|
||||
log.Fatal("goroutine poll:", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user