Browse Source

Fix benchmark -- needed to flush

pull/1780/head
Jae Kwon 9 years ago
parent
commit
e110a04ae2
3 changed files with 12 additions and 2 deletions
  1. +2
    -1
      cmd/counter/main.go
  2. +6
    -1
      cmd/dummy/main.go
  3. +4
    -0
      tests/benchmarks/simple/simple.go

+ 2
- 1
cmd/counter/main.go View File

@ -10,12 +10,13 @@ import (
func main() {
addrPtr := flag.String("addr", "tcp://0.0.0.0:46658", "Listen address")
serialPtr := flag.Bool("serial", false, "Enforce incrementing (serial) txs")
flag.Parse()
app := example.NewCounterApplication(*serialPtr)
// Start the listener
_, err := server.StartListener("tcp://0.0.0.0:46658", app)
_, err := server.StartListener(*addrPtr, app)
if err != nil {
Exit(err.Error())
}


+ 6
- 1
cmd/dummy/main.go View File

@ -1,6 +1,8 @@
package main
import (
"flag"
. "github.com/tendermint/go-common"
"github.com/tendermint/tmsp/example/golang"
"github.com/tendermint/tmsp/server"
@ -8,8 +10,11 @@ import (
func main() {
addrPtr := flag.String("addr", "tcp://0.0.0.0:46658", "Listen address")
flag.Parse()
// Start the listener
_, err := server.StartListener("tcp://0.0.0.0:46658", example.NewDummyApplication())
_, err := server.StartListener(*addrPtr, example.NewDummyApplication())
if err != nil {
Exit(err.Error())
}


+ 4
- 0
tests/benchmarks/simple/simple.go View File

@ -45,6 +45,10 @@ func makeRequest(conn net.Conn, req *types.Request) (*types.Response, error) {
if err != nil {
return nil, err
}
err = bufWriter.Flush()
if err != nil {
return nil, err
}
// Read desired response
var res = &types.Response{}


Loading…
Cancel
Save