Not able to connect remote appium server using IP address


I am trying to run my IOS script from windows machine by running appium server in MAC machine by passing the IP address of MAC machine. I get the following error :

Test Name: verifyIOS
Test FullName: UnitTestProject1.iosDriver.verifyIOS
Test Source: C:\Users\other\documents\visual studio 2015\Projects\UnitTestProject1\UnitTestProject1\iosDriver.cs : line 32
Test Outcome: Failed
Test Duration: 0:00:21.2291242

Result StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Appium.AppiumDriver1.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) at OpenQA.Selenium.Appium.AppiumDriver1…ctor(Uri remoteAddress, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Appium.iOS.IOSDriver1..ctor(Uri remoteAddress, DesiredCapabilities desiredCapabilities) at UnitTestProject1.iosDriver.verifyIOS() in C:\Users\other\documents\visual studio 2015\Projects\UnitTestProject1\UnitTestProject1\iosDriver.cs:line 48 Result Message: Test method UnitTestProject1.iosDriver.verifyIOS threw exception: OpenQA.Selenium.WebDriverException: Unexpected error. System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) --- End of inner exception stack trace --- at OpenQA.Selenium.Appium.Service.AppiumCommandExecutor.Execute(Command commandToExecute) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters)

Here’s my code:

DesiredCapabilities cap = new DesiredCapabilities();

        cap.SetCapability("automationName", "XCUITest");
        cap.SetCapability("platformName", "ios");
        cap.SetCapability("deviceName", "iPhone 6");
        cap.SetCapability("platformVersion", "10.3”);
        cap.SetCapability("fullReset", "False");
        cap.SetCapability("noReset", "True");
        cap.SetCapability("app", "/Users/apple/Downloads/");

        driver = new IOSDriver<IWebElement>(new Uri(""), cap);

     I tried passing my system IP and also public IP address but no luck. I launched manually Appium server in my MAC and gave a run from windows machine which is located at remote location. What could possible be the issue. Am I missing something. Like setting up access related stuffs in MAC or windows machine.

I also faced same issue and later found that I used wrong IP address of Mac system. After correcting, it worked without any issue