When creating a connection, a reader gorouine and heartbeater goroutine are started.
When sending a message using sends func, the reader can get the message, and the heartbeater gets the data from the deadlines.
However, there is a segment code in the send method as follows:
select {
case c.sends <- time.Now():
default:
}
I don't understand under what circumstances c.sends <- time.Now() is executed, when c.sends is a non-blocking channel of type chan time.Time.
Hope to receive your reply
When creating a connection, a reader gorouine and heartbeater goroutine are started. When sending a message using sends func, the reader can get the message, and the heartbeater gets the data from the deadlines. However, there is a segment code in the send method as follows: select { case c.sends <- time.Now(): default: } I don't understand under what circumstances c.sends <- time.Now() is executed, when c.sends is a non-blocking channel of type chan time.Time. Hope to receive your reply