Mohammad Shraim
Mohammad Shraim

Reputation: 1303

Error Domain=NSPOSIXErrorDomain Code=61 "The operation couldn\u2019t be completed. Connection refused"

I am using asyncSocket as client side, aim running my application on iPhone simulator, and the server side coded with C#. its working perfectly if i try to connect with a server on my LAN but the connection refused with the server out of my LAN.

I'am sure that the same server is working with another client code done on C#.

And this the message i get from socket Error:

>Error Domain=NSPOSIXErrorDomain Code=61 "The operation couldn\u2019t be completed. Connection refused"

Knowing that i get this message on connect phase before try to send data to server.

Any helping idea is appreciated.

Upvotes: 11

Views: 8092

Answers (2)

Hans Vader
Hans Vader

Reputation: 19

This just means that the connection failed, because the host could not be found / resolved. Make sure your websocket server is running and accessible for incoming connections. And check if the socket only listening for local ips.

Upvotes: 0

jer
jer

Reputation: 20236

Could be any number of issues here, but the important things to check include:

  • Firewalls that may be restricting incoming access and sending RST back to the client (thus simulating a connection refused);
  • DNS resolves to the same names from both locations where it works and where it doesn't
  • Posting code so we can look at your asyncsocket flow.

I'll update my answer when you post code if relevant.

Upvotes: 1

Related Questions