diff options
author | obscuren <geffobscura@gmail.com> | 2014-09-16 04:11:05 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-09-16 04:11:05 +0800 |
commit | 399256b38403f2e95312250d49fca3cada8956b8 (patch) | |
tree | 25ee8bb6334377fb18a39463c8bd85ea7878f641 /ethwire | |
parent | 33a0dec8a157b9687ca6038f4deb011f3f1f7bdc (diff) | |
download | go-tangerine-399256b38403f2e95312250d49fca3cada8956b8.tar.gz go-tangerine-399256b38403f2e95312250d49fca3cada8956b8.tar.zst go-tangerine-399256b38403f2e95312250d49fca3cada8956b8.zip |
VM execution fixes
Refactoring caused executing issues
Diffstat (limited to 'ethwire')
-rw-r--r-- | ethwire/messaging.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ethwire/messaging.go b/ethwire/messaging.go index 67a866f73..bee6dd526 100644 --- a/ethwire/messaging.go +++ b/ethwire/messaging.go @@ -282,8 +282,10 @@ func ReadMessages(conn net.Conn) (msgs []*Msg, err error) { var buff []byte var totalBytes int for { + // This is a bit of a cheat actually to make buffering extremely fast. + defer recover() // Give buffering some time - conn.SetReadDeadline(time.Now().Add(500 * time.Millisecond)) + conn.SetReadDeadline(time.Now().Add(5 * time.Millisecond)) // Create a new temporarily buffer b := make([]byte, 1440) // Wait for a message from this peer |