-
-
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
Delegate StompClientDidConnect not called after connect->disconnect->connect #15
Comments
Hello @gloryluu, |
Yes it did. |
@gloryluu I'm gonna check when I have time, let me some days :) |
Hello, I had the same problem in my fork (I'm building a nativescript plugin with it and I had to do some changes) and I've solved in this way: public func disconnect() {
if socket != nil {
connection = false
var headerToSend = [String: String]()
headerToSend[StompCommands.commandDisconnect] = String(Int(NSDate().timeIntervalSince1970))
sendFrame(command: StompCommands.commandDisconnect, header: headerToSend, body: nil)
socket!.close()
socket!.delegate = nil
socket = nil
}
} basically I close the socket, nil the delegate and then nil the socket itself (so it will be recreated). Hope this help Dem |
@gloryluu @demetrio812 Thank you so much for this contribution. I've added this to new version. Also, autoreconnect feature is going to be in this version after the tests are done :) |
Hello guys, |
hi @WrathChaos |
Hello @Mahdimm, |
thanks of replying @WrathChaos |
@Mahdimm |
@WrathChaos
and the use this function for disconnect: and for the second time use registerSocket() function to connect with new token but it could not register, for that reason I mentioned before! |
@Mahdimm Let me test fast. While I'm testing, can you please try to use reconnect function. Here is the example of it :
|
@WrathChaos |
@Mahdimm I guess you could not update the library itself.
and again run pod install command on your terminal. Also, I tried your use case on my test environment it works well. Please give me a feedback about your issue when you're done these steps :) |
@WrathChaos thanks |
@Mahdimm |
@WrathChaos |
Hello again @Mahdimm, |
Hey @Mahdimm, |
Hey @WrathChaos , |
Hello @MrShafiee, |
Hello @WrathChaos , and I have another question, is there any delegate function notify us when we subscribe on any destination? Thanks. |
There is no feature for subscrition delegate method but it is the first feature is going to work on it. It will be available soon :) I'm working on it. |
Hi @WrathChaos did you add delegate for subscribe & unSubscribe? thanks for supporting |
Hey @Mahdimm, |
@WrathChaos should the StompClientDidConnect delegate be called on connect/reconnect using autoreconnect method? (it is not for me) Another question - is it possible to get following delegate somehow? - (void)webSocket:(SRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean; |
Hi @deni2s, I am going to work on the new delegate methods ASAP. Still trying to make time for working on it. |
@WrathChaos I am using the latest version. |
@deni2s |
Hey @WrathChaos, thanks for this library, I try to use this, but unfortunately, none of the delegate is calling on my end. Not sure what I am missing!! I can see the log "WebSocket is connected" from the library, but my delegate method |
@WrathChaos couldn't get the Example to work at all, looks like pod file is outdated (no target platform defined, no minimum ios version defined). |
@gsathish02 and @deni2s , I'm working on it. I'm going to fix it tonight. |
Sorry guys could not make time for it. Before this weekend I will fix it. |
Hey guys @gsathish02 and @deni2s, |
Also, I've closed this issue, please re-open for your issues and let's continue on there. |
Hello, I have save issue, |
@xaeroolj Let's continue on your issue, please :) |
Hello. I have same problem too. I have log "WebSocket is connected", but delegate method stompClientDidConnect has called no where. Maybe it should be called in func webSocketDidOpen(_ webSocket: SRWebSocket!), where is print "WebSocket is connected"? |
Hello @4egoshev, Can you tell me which version are you using? |
I use 1.3.1 version |
@4egoshev Can you try with the latest release, please? (Currently 1.3.5) |
@WrathChaos sorry, but it does not solve my problem |
@4egoshev Can you provide me with a simple example on a repo? |
@WrathChaos sorry for waiting. I was so busy all last week. Do you know, it works good in simple example now. I think, maybe something wrong with our backend. Any way, thanks for your work!:+1: Good luck:slightly_smiling_face: |
@4egoshev Love to hear that, I hope you can make it work. Have fun :) |
That delegate not even called when I try to reconnect. Please tell me how to fix this? Thank you.
The text was updated successfully, but these errors were encountered: