processPong is used to process responses to the client's ping messages. We use pings for the flush mechanism as well.
()
| 4024 | // processPong is used to process responses to the client's ping |
| 4025 | // messages. We use pings for the flush mechanism as well. |
| 4026 | func (nc *Conn) processPong() { |
| 4027 | var ch chan struct{} |
| 4028 | |
| 4029 | nc.mu.Lock() |
| 4030 | if len(nc.pongs) > 0 { |
| 4031 | ch = nc.pongs[0] |
| 4032 | nc.pongs = append(nc.pongs[:0], nc.pongs[1:]...) |
| 4033 | } |
| 4034 | nc.pout = 0 |
| 4035 | nc.mu.Unlock() |
| 4036 | if ch != nil { |
| 4037 | ch <- struct{}{} |
| 4038 | } |
| 4039 | } |
| 4040 | |
| 4041 | // processOK is a placeholder for processing OK messages. |
| 4042 | func (nc *Conn) processOK() { |