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

get status of Socket Connection in Objective-c #157

Open
mostafatabal opened this issue Jan 19, 2018 · 6 comments
Open

get status of Socket Connection in Objective-c #157

mostafatabal opened this issue Jan 19, 2018 · 6 comments

Comments

@mostafatabal
Copy link

@nuclearace
All Docs in swift and i couldn't find in objective-c , please help

How check if socket connected or not and get status of socket connection and the emitting fails because not connected .. please give me code by Objective-c

@nuclearace
Copy link
Owner

You can translate Swift -> Objective-C nearly 1:1, it's not that different.

[socket on:@"connect" callback:^(NSArray* data, SocketAckEmitter* ack) {
    NSLog(@"socket connected");
}];

@mostafatabal
Copy link
Author

@nuclearace
the connection take more time and not connect , what can i do but i see in command line in server said connected, what is the problem ?

@nuclearace
Copy link
Owner

Again, if you look at the docs and the readme. You'll see how to enable logging. I'm don't have the time to translate everything to Objective-C.

@mostafatabal
Copy link
Author

i can do logging by adding @"log" : @yES but the log give me when try emit not connected and if call url in browser give me socket id that tell me i connected and this the response from server ..

@mostafatabal
Copy link
Author

@nuclearace

@nuclearace
Copy link
Owner

Well:

  1. Learn to translate Swift -> Objective-C and use the docs. It's not hard.
  2. You have to emit after connecting.
  3. If you aren't connecting then you need to look at the logs and find out why it's not connecting.

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

No branches or pull requests

2 participants