Ethan Buchman
9dde1a0bd4
rpc: comments
2017-08-25 17:57:09 -04:00
Anton Kaliaev
2fd8496bc1
correct handling of pings and pongs
...
server:
- always has read & write timeouts
- ping handler never blocks the reader (see A)
- sends regular pings to check up on a client
A:
at some point server write buffer can become full, so in order not to
block reads from a client (see
https://github.com/gorilla/websocket/issues/97 ), server may skip some
pongs. As a result, client may disconnect. But you either have to do
that or block the reader. There is no third way.
client:
- optional read & write timeouts
- optional ping/pong to measure latency
2017-08-10 17:53:49 -04:00
Anton Kaliaev
236489aecf
backlog must always have higher priority
2017-08-08 19:03:48 -04:00
Ethan Buchman
797acbe911
ws: small comment
2017-08-08 17:33:17 -04:00
Anton Kaliaev
9b5f21a650
[ws-server] reset readTimeout when we receive something
2017-08-08 16:03:04 -04:00
Anton Kaliaev
8267920749
[ws-client] write normal close message
2017-08-08 16:02:37 -04:00
Anton Kaliaev
6c85e4be4f
change server ping period to be less frequent
...
no need to ping ws every 10 sec
2017-08-08 13:21:59 -04:00
Anton Kaliaev
23a87304cc
add a comment for PingPongLatencyTimer [ci skip]
2017-08-08 13:20:58 -04:00
Anton Kaliaev
c14b39da5f
make RPC server's ping period and pong wait configurable via options
2017-08-07 18:29:55 -04:00
Anton Kaliaev
57eee2466b
make WSClient thread-safe
2017-08-07 17:56:38 -04:00
Anton Kaliaev
5d66d1c28c
fixes from review
2017-08-05 13:11:00 -04:00
Anton Kaliaev
0013053fae
allow to change pong wait and ping period
2017-08-04 10:42:55 -04:00
Anton Kaliaev
1abbb11b44
do not exit from reconnectRoutine!
2017-08-03 22:44:18 -04:00
Anton Kaliaev
54903adeff
add IsReconnecting and IsActive methods
2017-08-03 19:10:15 -04:00
Anton Kaliaev
c08618f7e9
expose latency timer on WSClient
2017-08-03 19:10:14 -04:00
Anton Kaliaev
d578f7f81e
biff up WS client
...
What's new:
- auto reconnect
- ping/pong
- colored tests
2017-08-03 19:10:14 -04:00
Ethan Buchman
0d1fa8e884
fixes from review
2017-06-28 11:12:45 -04:00
Ethan Buchman
e2ed15fa02
rpc: SetWriteDeadline for ws ping. fixes #553
2017-06-26 17:13:39 -04:00
Ethan Buchman
b6031d5f4b
rpc/lib: set logger on ws conn
2017-06-24 21:55:31 -04:00
Ethan Buchman
5c29d7aba9
rpc/lib: test tcp and unix
2017-06-24 21:27:19 -04:00
Ethan Frey
aac85a14f0
httpDialer accepts no prefix or http:// as tcp://
2017-06-22 20:56:57 +02:00
Anton Kaliaev
b4ece65726
standardize key for errors (should be "err")
2017-06-14 12:50:49 +04:00
Ethan Frey
2b324b7eb9
RPC returns pretty formated json
2017-05-14 19:06:34 +02:00
Anton Kaliaev
f8fdbe3dbc
changes as per Bucky's review
2017-05-13 16:22:51 +02:00
Anton Kaliaev
f803544195
new logging
2017-05-13 10:24:58 +02:00
Ethan Buchman
75989342b0
fixes from rebase
2017-05-04 23:03:42 -04:00
Ethan Buchman
9860c8fee1
rpc: cleanup some comments [ci skip]
2017-05-03 14:33:07 -04:00
Ethan Frey
4a1b714ca4
All tests pass without go-wire json ptr madness
2017-05-03 16:45:00 +02:00
Ethan Frey
4c1d41c12e
Test json rpc parsing
2017-05-03 16:26:18 +02:00
Ethan Frey
6ba799132c
json.RawMessage in RPCRequest to defer parsing
2017-05-03 16:13:58 +02:00
Ethan Buchman
6dbcfb32d2
comment on copied wire file
2017-04-28 23:22:54 -04:00
Ethan Buchman
efeadcc0f4
some cleanup from review
2017-04-28 23:18:38 -04:00
Ethan Buchman
884060eb9b
rpc/lib: no Result wrapper
2017-04-28 22:04:14 -04:00
Ethan Buchman
07e59e63f9
TMEventDataInner
2017-04-28 17:57:06 -04:00
Ethan Buchman
ac28b12fa8
add readReflectJSON from wire
2017-04-28 17:56:44 -04:00
Ethan Frey
257f45b768
ebuchman: added some demos on how to parse unknown types
2017-04-28 22:01:46 +02:00
Ethan Buchman
acfbea6d49
rpc: decode args without wire
2017-04-28 14:36:38 -04:00
Ethan Frey
6c60c07f16
BROKEN: attempt to replace go-wire.JSON with json.Unmarshall in rpc
2017-04-28 16:24:06 +02:00
Ethan Frey
194f345470
Use non-standard port so tests don't die when I am running basecoin
2017-04-28 14:45:34 +02:00
Ethan Buchman
cc6dde96c1
rpc -> rpc/lib and rpc/tendermint -> rpc
2017-04-26 19:57:33 -04:00