MaybeHasData tries to peek at the next byte in the socket without consuming it This is used to check if there are push notifications available Important: This will work on Linux, but not on Windows
()
| 967 | // This is used to check if there are push notifications available |
| 968 | // Important: This will work on Linux, but not on Windows |
| 969 | func (cn *Conn) MaybeHasData() bool { |
| 970 | // Lock-free netConn access for better performance |
| 971 | if netConn := cn.getNetConn(); netConn != nil { |
| 972 | return maybeHasData(netConn) |
| 973 | } |
| 974 | return false |
| 975 | } |
| 976 | |
| 977 | // deadline computes the effective deadline time based on context and timeout. |
| 978 | // It updates the usedAt timestamp to now. |
no test coverage detected