This PR adds code and reason parameters to the Socket.onClose callback. This allows clients to know why a socket was closed.
The two parameters were added in a non-breaking manner by keeping the existing methods that don't supply the two additional parameters in the callback closures.
The only potentially breaking change is when implementing a custom PheonixTransport or PhoenixTransportDelegate, the onClose method now has an additional reason: String? parameter. This is unlikely to impact typical usages of SwiftPhoenixClient since URLSessionTransport and Socket are the natural implementors of PheonixTransport and PhoenixTransportDelegate, respectively.
This PR adds
code
andreason
parameters to theSocket.onClose
callback. This allows clients to know why a socket was closed.The two parameters were added in a non-breaking manner by keeping the existing methods that don't supply the two additional parameters in the callback closures.
The only potentially breaking change is when implementing a custom
PheonixTransport
orPhoenixTransportDelegate
, theonClose
method now has an additionalreason: String?
parameter. This is unlikely to impact typical usages of SwiftPhoenixClient sinceURLSessionTransport
andSocket
are the natural implementors ofPheonixTransport
andPhoenixTransportDelegate
, respectively.