aries-framework-swift icon indicating copy to clipboard operation
aries-framework-swift copied to clipboard

WebSocket OutboundTransport can be closed

Open kukgini opened this issue 3 years ago • 0 comments

When a Invitation which has websocket endpoint is received, the existing socket already connected to the mediator can be disappeared in WsOutboundTransport.

@conanac says: For now, we keep only one WebSocket session, so the previous session, in this case, the session for the ACA-Py mediator, can be closed. That session will be recovered soon because we periodically send a ping to the mediator. At this time, the ws session for the counterparty agent may be closed. But, it will not be a problem because the counterparty agent could still send messages via the mediator.

That said, it may be better if we keep a session for each WebSocket endpoint. We will need the following jobs:

  • Prepare a map of sockets
  • Do not send a ping periodically to the mediator, instead send a ping when the App enters foreground. This should be done by the App and we provide a function for the App to call.

kukgini avatar Dec 14 '22 23:12 kukgini