deniszykov / WebSocketListener

A lightweight and highly scalable asynchronous WebSocket listener
http://vtortola.github.io/WebSocketListener
81 stars 17 forks source link

Not-so-transparent ping/pong (Documentation) #19

Closed fuzzykiller closed 6 years ago

fuzzykiller commented 6 years ago

I just played around a little with the library. My use case is just about sending (large amounts of) data to the client. So I never called ReadMessageAsync at all.

After getting mysterious connection drops and debugging through it all I finally found the reason: pong messages are not processed at all unless I call ReadMessageAsync. To me, this is quite surprising. I feel the documentation should emphasize strongly that calling ReadMessageAsync is absolutely mandatory when pinging is not disabled, even if no messages are expected.

deniszykov commented 6 years ago

I will mention it in docs. Thanks!

deniszykov commented 6 years ago

Added in de55bb5ad2deb25384d78c3b044f33d5219c4fd2