No order message from websocket after several hours

Hello, when using SpotWebsocketStreamClient.user_data(), do i still need to take care of listen_key expiration or connection timeouts by myself? I followed the official example and i can receive the order message initially, but after a few hours, I stop receiving new trade messages. However, I continue to receive ping messages (‘Received Ping; PONG frame sent back’ every 3 minutes). Any insights on this?

With Received Ping; PONG frame sent back in the log, it means the websocket connection is healthy. However the listenkey should be regularly renewed to keep active:

  • A User Data Stream listenKey is valid for 60 minutes after creation.
  • Doing a PUT on an active listenKey will extend its validity for 60 minutes.

Thank you!