Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the didreceive event protocol #994

Open
rajeshblaze opened this issue Dec 14, 2023 · 0 comments
Open

Change the didreceive event protocol #994

rajeshblaze opened this issue Dec 14, 2023 · 0 comments
Labels

Comments

@rajeshblaze
Copy link

rajeshblaze commented Dec 14, 2023

Describe the bug

A clear and concise description of what the bug is.

To handle the multiple socket connections using the dictionary

var webSockets: [String: (socket: WebSocket, status: Bool)] = [:]

After receiving connected status success then updating the dictionary with status true

func didReceive(event: WebSocketEvent, client: WebSocket) {
    switch event {
    case .connected(let headers):
        var socket = webSockets[client.request.url?.absoluteString ?? ""]
        
        let wssServerUrl = BUtility().getValueFromKeyChain(key: KeyConstant.kWssServerURL)
        if wssServerUrl == client.request.url?.absoluteString ?? "" {
            webSockets[client.request.url?.absoluteString ?? ""]?.status = true
        }
    }
}

Now update the pod to 4.0.6
Then replaced the function with client

From the client or event how i can ge tthe url from the client
func didReceive(event: WebSocketEvent, client: WebSocketClient) {
}

  • OS/Version: [e.g. iOS/17.0.1]
  • Starscream Version [4.0.6]
  • Xcode version [ 15.0.1]

Additional context

Add any other context about the problem here.
Suggestion: How to get socket from the client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant