socket.IO-objc icon indicating copy to clipboard operation
socket.IO-objc copied to clipboard

ERROR: handshake failed ... A server with the specified hostname could not be found.

Open zhangpan opened this issue 12 years ago • 8 comments

i use the socket all is ok,but when i disconnect wifi ,then reconncect the wifi ,it give me

-[SocketIO connection:didFailWithError:] ERROR: handshake failed ... A server with the specified hostname could not be found.

is this client mistake or server mistake? how to resolve it

zhangpan avatar Nov 22 '12 08:11 zhangpan

Did you ever figure this out? I have a socketIO server running on Heroku. I'm unsure what port I'm suposed to be listening to be listening to. My javascript client works when I don't specify a port number. With this library, I don't have the option of not specifying a port number.

SivaDotRender avatar Sep 11 '14 04:09 SivaDotRender

Does this error got resolve ? Any Solution ?

ShreyasSA avatar Sep 24 '14 05:09 ShreyasSA

@ShreyasSA I fixed my problem but it was something trivial. If you give me more information I can help you debug your problem.

SivaDotRender avatar Sep 26 '14 22:09 SivaDotRender

Hey guys, I'm facing the same issue here. When I connect to the server on a browser using the same URL it works fine but when I try to connect thru my Xcode program it throws an error! Any guess why this could be happening?

anuradhavasudeva avatar Oct 02 '14 13:10 anuradhavasudeva

I think a common mistake is to not omit the "http://" part of the host url when using the connectToHost method. This is added automatically. So instead of "http://www.example.com", use "example.com".

SivaDotRender avatar Oct 03 '14 04:10 SivaDotRender

BTW, I altered my code to send a proper URL...as follows. I think Socket IO appends http on its own ..so sending http is redundant..so my call to connecttohost looks like this :

[_socketConnection connectToHost:@"bubbleme.azurewebsites.net"

onPort:80 withParams:nil withNamespace:@""];

I get the error below now...

Warning: Error creating LLDB target at path '/Users/anuradhavasudeva/Desktop/Buzz/Complete/CWPAYou/Build/Products/Debug-iphonesimulator/CWPAYou.app'- using an empty LLDB target which can cause slow memory reads from remote devices. 2014-10-02 21:40:12.355 CWPAYou[11590:340614] Can't find keyplane that supports type 5 for keyboard iPhone-Portrait-PhonePad; using 2870935746_Portrait_iPhone-Complex-Pad_Default 2014-10-02 21:40:26.335 CWPAYou[11590:340614] Connecting to socket with URL: http://bubbleme.azurewebsites.net:80/socket.io/1/?t=1412257226336 2014-10-02 21:40:31.194 CWPAYou[11590:340614] send() 2014-10-02 21:40:31.194 CWPAYou[11590:340614] queue >>> 5:1+::{"args":[{"key2":"test2","key1":"test1"}],"name":"join"} 2014-10-02 21:40:31.415 CWPAYou[11590:340614] didReceiveResponse() 400 2014-10-02 21:40:31.415 CWPAYou[11590:340614] ERROR: handshake failed ... Server returned status code 400

Sent from my Google Nexus Phone On Oct 3, 2014 12:08 PM, "Sivathmican Sivakumaran" [email protected] wrote:

I think a common mistake is to not omit the "http://" part of the host url when using the connectToHost method. This is added automatically. So instead of "http://www.example.com", use "example.com".

— Reply to this email directly or view it on GitHub https://github.com/pkyeck/socket.IO-objc/issues/55#issuecomment-57749523 .

anuradhavasudeva avatar Oct 03 '14 07:10 anuradhavasudeva

@anuradhavasudeva I suspect the port you have used is wrong.

yunas avatar May 30 '15 20:05 yunas

@anuradhavasudeva Does this error got resolve ? Any Solution ?

IOSLZZ avatar Aug 09 '16 02:08 IOSLZZ