soheilhy / cmux

Connection multiplexer for GoLang: serve different services on the same port!
Apache License 2.0
2.58k stars 199 forks source link

Matching a no-op tcp connection will blocking for-ever #65

Closed barryz closed 5 years ago

barryz commented 5 years ago

Once a tcp connection established, but without send any data. Like nc localhost 8080 with no latter operations.

This may cause the matching process to block for-ever until a min length of data is received and the connection may never receives a stop signal(donec). Issue code line : https://github.com/soheilhy/cmux/blob/8a8ea3c53959009183d7914522833c1ed8835020/cmux.go#L184

july2993 commented 5 years ago

maybe you can set SetReadTimeout to address you problem

barryz commented 5 years ago

yep, I already fixed it. Thanks for your reply.