locked
Local host (127.0.0.1) is not working if Data is send from win32 socket to WinRT socket ?

    Question

  • I run the DatagramSocket  (Microsoftsample code for UDP) in windows 8.1 visual studio 2012. I run the listener on a specific port.

    I run another win32 socket in the same pc. Then Try to send data on the port where my WinRT server is running.

    While sending i use the localhost IP(127.0.0.1).

    But i find Its not working Sending Data from win32 to WinRT in same pc.But It works if they are in two different pc.

    Sending data from WinRT to Win32 is working in a single pc. Sending data from WinRT to WinRT also works in  a single pc using localhost

    I am not been able to trace  whats the problem if Win32 send Data to WinRT.

    Thank you

    Saturday, May 10, 2014 5:16 PM

Answers

  • Hi,

    Connecting to a loopback address (127.0.0.1 or localhost) is not supported in a Windows Store application.  Period.

    However, connecting to localhost while debugging an application in Visual Studio IS supported.  For example, suppose you have an app that connects to a web service to consume data, and to test it, you want to host the web service on your development machine.  This does work.  How to get it working is a little bit obscure.

    To enable connections to localhost, you need to do two things in the blog:

    http://teamjohnston.net/blog/2013/07/08/windows-8-apps-streamsocket-connection-to-localhost/

    And you can refer to the discussion below:

    http://social.msdn.microsoft.com/Forums/windowsapps/en-US/9499448d-89d8-4675-ba70-0af9f4506ba1/connecting-to-localhost-from-windows-store-app

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Fahad_Ahmed Monday, May 12, 2014 7:57 AM
    Monday, May 12, 2014 3:17 AM

All replies

  • Hi,

    Connecting to a loopback address (127.0.0.1 or localhost) is not supported in a Windows Store application.  Period.

    However, connecting to localhost while debugging an application in Visual Studio IS supported.  For example, suppose you have an app that connects to a web service to consume data, and to test it, you want to host the web service on your development machine.  This does work.  How to get it working is a little bit obscure.

    To enable connections to localhost, you need to do two things in the blog:

    http://teamjohnston.net/blog/2013/07/08/windows-8-apps-streamsocket-connection-to-localhost/

    And you can refer to the discussion below:

    http://social.msdn.microsoft.com/Forums/windowsapps/en-US/9499448d-89d8-4675-ba70-0af9f4506ba1/connecting-to-localhost-from-windows-store-app

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Fahad_Ahmed Monday, May 12, 2014 7:57 AM
    Monday, May 12, 2014 3:17 AM
  • Thank you.

    I have registered to participate on the survey you mentioned

    Monday, May 12, 2014 8:07 AM