Hi,
I use the WSEngine with both methods: disconnect() and forceDisconnect(). Now I figured out, that the handling of this methods are different. From my perspective there is one missing call in the forceDisconnect() method.
In WSEngine.stop() which is called via disconnect():
write(data: payload, opcode: .connectionClose, completion: { [weak self] in
self?.reset()
self?.forceStop()
})
In WSEngine forceStop() which is called via forceDisconnect():
public func forceStop() {
transport.disconnect()
}
If we re-init or reconnect a socket, there will be called WSEngine.start(request:) method. In some cases by using WebSocket.forceDisconnect() the property canSend won't be reset to false. In that case the method start(request:) will be returned at the beginning and no connection will be created.
Has anybody the same issue?
Hi,
I use the
WSEnginewith both methods:disconnect()andforceDisconnect(). Now I figured out, that the handling of this methods are different. From my perspective there is one missing call in theforceDisconnect()method.In
WSEngine.stop()which is called viadisconnect():In
WSEngine forceStop()which is called viaforceDisconnect():If we re-init or reconnect a socket, there will be called
WSEngine.start(request:)method. In some cases by usingWebSocket.forceDisconnect()the propertycanSendwon't be reset to false. In that case the methodstart(request:)will be returned at the beginning and no connection will be created.Has anybody the same issue?