Keep reading until something causes the connection to die (EOF, server closed, etc). Useful as a tool for mindlessly keeping the connection healthy, since the client will error if things like client prefaces are not accepted in a timely fashion.
(conn net.Conn)
| 53 | // healthy, since the client will error if things like client prefaces are not |
| 54 | // accepted in a timely fashion. |
| 55 | func keepReading(conn net.Conn) { |
| 56 | io.Copy(io.Discard, conn) |
| 57 | } |
| 58 | |
| 59 | type funcConnectivityStateSubscriber struct { |
| 60 | onMsg func(connectivity.State) |
no test coverage detected