Skip to content

PONG timeouts or How to gracefully reconnect with MCSubscriber #34

@patrickcusack

Description

@patrickcusack

I am encounterig the following Pong time outs across several devices (iPad, iOS, simulator) running the latest SDK. I didn't experience this when using the 2.x SDK. Can you explain what is 1) Going on here? Are these solely web socket timeouts? Can we increase the number of failed timeouts or change the web socket behavior? 2) How do I recover from this? I don't see this behavior on the web SDK or in the player. Basically I have to restart my connection every few minutes. I added a subscriber for web socket states. I never see failed. How do I work around this? These connections are on varied connections, wired and wifi - different networks.

2025/11/20 20:33:29.924721 [SDK|WARNING] [[websocket_task_queue_impl.cc:314](http://websocket_task_queue_impl.cc:314/)] 	Pong timeout
2025/11/20 20:33:32.296473 [SDK|DEBUG] [[state_machine.cc:45](http://state_machine.cc:45/)] 	ConnectionSM requesting state reconnecting
2025/11/20 20:33:32.296677 [SDK|DEBUG] [[state_machine.cc:238](http://state_machine.cc:238/)] 	ConnectionSM initiating transition from connected to reconnecting
2025/11/20 20:33:32.297457 [SDK|DEBUG] [[state_machine.cc:45](http://state_machine.cc:45/)] 	ConnectionSM requesting state connected
2025/11/20 20:33:32.297590 [SDK|INFO] [[state_machine.cc:287](http://state_machine.cc:287/)] 	ConnectionSM reached state reconnecting
2025/11/20 20:33:32.297688 [SDK|DEBUG] [[state_machine.cc:238](http://state_machine.cc:238/)] 	ConnectionSM initiating transition from reconnecting to disconnecting
WebSocket connected
WebSocket disconnecting
2025/11/20 20:33:32.798813 [SDK|DEBUG] [[state_machine.cc:287](http://state_machine.cc:287/)] 	ConnectionSM reached state disconnecting
2025/11/20 20:33:32.798998 [SDK|DEBUG] [[state_machine.cc:238](http://state_machine.cc:238/)] 	ConnectionSM initiating transition from disconnecting to idle
2025/11/20 20:33:32.799133 [SDK|DEBUG] [[state_machine.cc:45](http://state_machine.cc:45/)] 	ProjectionSM requesting state IDLE
2025/11/20 20:33:32.799213 [SDK|DEBUG] [[state_machine.cc:238](http://state_machine.cc:238/)] 	ProjectionSM initiating transition from PROJECTED to IDLE
2025/11/20 20:33:32.799282 [SDK|INFO] [[state_machine.cc:287](http://state_machine.cc:287/)] 	ProjectionSM reached state IDLE
2025/11/20 20:33:32.799364 [SDK|INFO] [[projection_state.cc:1213](http://projection_state.cc:1213/)] 	Enabling projection tracks masking for seamless migration after reconnection
2025/11/20 20:33:32.799454 [SDK|DEBUG] [[state_machine.cc:45](http://state_machine.cc:45/)] 	ProjectionSM requesting state IDLE
2025/11/20 20:33:32.799524 [SDK|DEBUG] [[state_machine.cc:401](http://state_machine.cc:401/)] 	ProjectionSM requested transition to IDLE completed
2025/11/20 20:33:32.799676 [SDK|DEBUG] [[projection_state.cc:488](http://projection_state.cc:488/)] 	Resetting peerconnection, invalidating all tracks projections
2025/11/20 20:33:32.828823 [SDK|INFO] TvosAudioDeviceModule::UpdateProcessing()
2025/11/20 20:33:32.830103 [SDK|WARNING] [[websocket_manager.cc:103](http://websocket_manager.cc:103/)] 	Websocket currently closed, dropping message!
2025/11/20 20:33:32.830188 [SDK|WARNING] [[transaction_manager.cc:44](http://transaction_manager.cc:44/)] 	Failed transaction 3, Operation cancelled: operation's solver abandoned before producing the result
2025/11/20 20:33:32.830276 [SDK|DEBUG] [[websocket_manager.cc:41](http://websocket_manager.cc:41/)] 	websocket manager preparing destruction!
2025/11/20 20:33:32.830336 [SDK|DEBUG] [[websocket_manager.cc:47](http://websocket_manager.cc:47/)] 	Websocket has been shutdown!
2025/11/20 20:33:32.830396 [SDK|DEBUG] [[projection_state.cc:506](http://projection_state.cc:506/)] 	Resetting RTS connection, invalidating all tracks activity states
2025/11/20 20:33:32.830457 [SDK|DEBUG] [[state_machine.cc:287](http://state_machine.cc:287/)] 	ConnectionSM reached state idle
2025/11/20 20:33:32.830540 [SDK|DEBUG] [[state_machine.cc:238](http://state_machine.cc:238/)] 	ConnectionSM initiating transition from idle to connecting
2025/11/20 20:33:32.830634 [SDK|DEBUG] [[state_machine.cc:287](http://state_machine.cc:287/)] 	ConnectionSM reached state connecting
2025/11/20 20:33:32.830694 [SDK|DEBUG] [[state_machine.cc:238](http://state_machine.cc:238/)] 	ConnectionSM initiating transition from connecting to connected
WebSocket idle
WebSocket connecting...
nw_endpoint_flow_add_one_protocol [C3.1.1.1 18.164.174.63:443 in_progress socket-flow (satisfied (Path is satisfied), interface: en7)] Failed to create protocol handler: quic-connection
nw_endpoint_flow_failed_with_error [C3.1.1.1 18.164.174.63:443 in_progress socket-flow (satisfied (Path is satisfied), interface: en7)] already failing, returning
nw_endpoint_flow_add_one_protocol [C3.1.1.2 18.164.174.129:443 in_progress socket-flow (satisfied (Path is satisfied), interface: en7)] Failed to create protocol handler: quic-connection
nw_endpoint_flow_failed_with_error [C3.1.1.2 18.164.174.129:443 in_progress socket-flow (satisfied (Path is satisfied), interface: en7)] already failing, returning
nw_endpoint_flow_add_one_protocol [C3.1.1.3 18.164.174.14:443 in_progress socket-flow (satisfied (Path is satisfied), interface: en7)] Failed to create protocol handler: quic-connection
nw_endpoint_flow_failed_with_error [C3.1.1.3 18.164.174.14:443 in_progress socket-flow (satisfied (Path is satisfied), interface: en7)] already failing, returning
nw_endpoint_flow_add_one_protocol [C3.1.1.4 18.164.174.20:443 in_progress socket-flow (satisfied (Path is satisfied), interface: en7)] Failed to create protocol handler: quic-connection
nw_endpoint_flow_failed_with_error [C3.1.1.4 18.164.174.20:443 in_progress socket-flow (satisfied (Path is satisfied), interface: en7)] already failing, returning
2025/11/20 20:33:33.059337 [SDK|ERROR] [millicast_client.cpp:590] 	Unauthorized(401): Http Error: Unauthorized(401)
2025/11/20 20:33:33.059489 [SDK|INFO] [millicast_client.cpp:591] 	[Sub][Fail] Connection failed, trying to reconnect if allowed in config...
2025/11/20 20:33:33.059559 [SDK|DEBUG] [millicast_client.cpp:538] 	Reconnects disabled, disconnecting on error
2025/11/20 20:33:33.059623 [SDK|DEBUG] [[state_machine.cc:45](http://state_machine.cc:45/)] 	ConnectionSM requesting state idle
2025/11/20 20:33:33.059731 [SDK|WARNING] [[state_machine.cc:312](http://state_machine.cc:312/)] 	ConnectionSM failed to reach state connected. The state stays in connecting and the transition to connected is aborted: Unauthorized(401): Http Error: Unauthorized(401): Error: REST API error response
2025/11/20 20:33:33.059845 [SDK|DEBUG] [[state_machine.cc:238](http://state_machine.cc:238/)] 	ConnectionSM initiating transition from connecting to disconnecting
2025/11/20 20:33:33.059997 [SDK|DEBUG] [[state_machine.cc:287](http://state_machine.cc:287/)] 	ConnectionSM reached state disconnecting
2025/11/20 20:33:33.060075 [SDK|DEBUG] [[state_machine.cc:238](http://state_machine.cc:238/)] 	ConnectionSM initiating transition from disconnecting to idle
2025/11/20 20:33:33.060176 [SDK|INFO] [[state_machine.cc:287](http://state_machine.cc:287/)] 	ConnectionSM reached state idle
WebSocket idle

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions