Hello, does anyone have an example of this or could audit something I've put
together?
I have a StreamServer that accepts connections from a client and then does
duplex async msgpack rpc - the server can call the client and the client can
call the server. Messages can return responses out of order.
Only one greenlet reads from the socket and only one writes - I serialize
writes using a Queue and I've ended up wrapping all the socket read/sends in
gevent.Timeouts -- ssl sockets or perhaps sockets in general can just seem to
hang forever. I also have a greenlet on the client that sends pings over the
socket every 5s, if I don't see a pong quickly enough in the client, I consider
the connection dead and reconnect.
https://github.com/mattbillenstein/salty/blob/master/salty.py#L114
This works, but seems complex - if anyone knows a more canonical implementation
of this or has an pointers - thanks in advance!
m
--
Matt Billenstein
ma...@vazor.com
https://vazor.com