summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-06-12 23:43:06 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-06-12 23:43:06 +0200
commitebeab355ca78014f46e83cb20dc81f91e37ff491 (patch)
tree35cbe9896b8ee1317562bad4d0cf7a5987f92c87
parentf66f53a2e45eb016e5cb2d10dd4debd03ee32b9e (diff)
Very slow
-rw-r--r--main.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/main.go b/main.go
index cc69baf..0367ad3 100644
--- a/main.go
+++ b/main.go
@@ -33,8 +33,7 @@ type Data struct {
}
func dump(dir Direction, src, dst net.Conn, data chan<- Data) error {
- //buf := make([]byte, 1452)
- buf := make([]byte, 10)
+ buf := make([]byte, 1)
for k := 1; ; k++ {
now := time.Now()
n, err := src.Read(buf)
@@ -47,7 +46,7 @@ func dump(dir Direction, src, dst net.Conn, data chan<- Data) error {
}
data <- Data{Round: k, Dir: dir, Data: buf[:n], Size: n, Time: spent}
- time.Sleep(10 * time.Millisecond)
+ time.Sleep(time.Second)
_, err = dst.Write(buf[:n])
if err != nil {