-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Didconnect function cannot be callback after successful connection #43
Comments
Hello @yongjunta, |
Hello, what I want to ask is whether I automatically enter the StompClientDidConnect method when the connection with the server is successful. The subscription method I wrote in the StompClientDidConnect method has not been executed. It should be that I did not enter the StompClientDidConnect method at all. What should we do in this case? I hope you can give me Demo. Thank you!
…------------------ 原始邮件 ------------------
发件人: "FreakyCoder"<[email protected]>;
发送时间: 2019年5月23日(星期四) 晚上6:20
收件人: "WrathChaos/StompClientLib"<[email protected]>;
抄送: "DO"<[email protected]>;"Mention"<[email protected]>;
主题: Re: [WrathChaos/StompClientLib] Didconnect function cannot becallback after successful connection (#43)
Hello @yongjunta,
Thank you so much for using the lib and create an issue about it :)
This library is more than 2 years old therefore, I did not need a callback method for stompClientDidConnect method. Also, I believe that people can create a business logic with this protocol method.
Of course, PR's are welcome for this little feature :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I am having the same issue ... ... Here's what i did: In my viewDidLoad(), I put it never reaches the method stompClientDidConnect : I did some debugging. In StompClientLib.sendFrame(), it always goes into the if statement:
|
I guess in order to make it work it needs this commit:
specifically this line |
Hello @yhz82415, |
The problem I encountered was not Springboot's reason. He entered the if statement to judge whether the connection was disconnected. We just need to activate DidConnect's method under the connection method in the webSocket DidOpen method and subscribe to DidConnect's method.
like this :
public func webSocketDidOpen(_ webSocket: SRWebSocket!) {
print("WebSocket is connected")
connect()
DispatchQueue.main.async(execute: { [weak self] in
self?.delegate?.stompClientDidConnect(client: self)
})
}
…------------------ 原始邮件 ------------------
发件人: "yhz82415"<[email protected]>;
发送时间: 2019年6月6日(星期四) 上午8:32
收件人: "WrathChaos/StompClientLib"<[email protected]>;
抄送: "DO"<[email protected]>;"Mention"<[email protected]>;
主题: Re: [WrathChaos/StompClientLib] Didconnect function cannot becallback after successful connection (#43)
I guess in order to make it work it needs this commit:
ba521b4
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@yongjunta, which version are you working on? |
The swift 4.2 I used at the time |
1.2.7,The swift 4.2 I used at the time |
Can you try 1.3.0 version with Swift 4.2? It should have been supported with the latest version. |
Is the latest version 1.3.0? If so there are 3 commits in that version but doesn't have the commit for spring boot support ba521b4 . 1.3.0...master |
nvm it is there |
@yongjunta, still waiting for you to close this issue :) |
@WrathChaos Hi there. I did checkout version 1.3.1 but I don't see the below commit |
Good to hear @duannl :) |
When the connection with the server is successful, the console also prints WebSocket is connected, but there is no callback to stompClientDidConnect method, why?
The text was updated successfully, but these errors were encountered: