allow to change pong wait and ping period

This commit is contained in:
Anton Kaliaev
2017-08-04 10:30:22 -04:00
parent 1abbb11b44
commit 0013053fae
2 changed files with 40 additions and 13 deletions

View File

@ -11,6 +11,7 @@ import (
"time"
"github.com/gorilla/websocket"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/tendermint/tmlibs/log"
@ -188,6 +189,12 @@ func TestWSClientReconnectFailure(t *testing.T) {
}
}
func TestWSClientPingPongOption(t *testing.T) {
assert.Panics(t, func() {
NewWSClient("tcp://localhost:8080", "/websocket", PingPong(2*time.Second, 2*time.Second))
})
}
func startClient(t *testing.T, addr net.Addr) *WSClient {
c := NewWSClient(addr.String(), "/websocket")
_, err := c.Start()