ClearHandoffState clears the handoff state after successful handoff. Makes the connection usable again.
()
| 833 | // ClearHandoffState clears the handoff state after successful handoff. |
| 834 | // Makes the connection usable again. |
| 835 | func (cn *Conn) ClearHandoffState() { |
| 836 | // Clear handoff metadata |
| 837 | cn.handoffStateAtomic.Store(&HandoffState{ |
| 838 | ShouldHandoff: false, |
| 839 | Endpoint: "", |
| 840 | SeqID: 0, |
| 841 | }) |
| 842 | |
| 843 | // Reset retry counter |
| 844 | cn.handoffRetriesAtomic.Store(0) |
| 845 | |
| 846 | // Mark connection as usable again |
| 847 | // Use state machine directly instead of deprecated SetUsable |
| 848 | // probably done by initConn |
| 849 | cn.stateMachine.Transition(StateIdle) |
| 850 | } |
| 851 | |
| 852 | // HasBufferedData safely checks if the connection has buffered data. |
| 853 | // This method is used to avoid data races when checking for push notifications. |