11

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.

Chris
  • 1,416
  • 18
  • 29
Mohammad Shraim
  • 1,173
  • 12
  • 21
  • Havre you tried to reduce this to a minimal test case? It would help us to answer if you posted your iOS code. Probably also helpful if you post the C# code from the matching minimal test case that works, too. – Olie Jul 01 '13 at 17:35

2 Answers2

1

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.

jer
  • 20,094
  • 5
  • 45
  • 69
0

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.

Hans Vader
  • 19
  • 6