locked
Why do apps using the StreamSocketListener class not allow local connections?

    Question

  • I have an app which I intended to use StreamSocketListener as an IPC protocol (similar to using WinSock on a non metro / console application which I have already done and works perfectly).

    After struggling and wondering what I was doing wrong when none of my local clients would connect to my application I decided to use a remote client to test it and voila it works.

    This leads me to ask a couple things.

    1. Why is there no support for local connections

    2. If there is support for local connections how to I enable it. 

    3. What other methods of IPC are available for Metro apps. (I tried using named pipes at first, but none of the named piped functions were defined after including Windows.h and WinBase.h)

    Wednesday, August 20, 2014 2:18 AM

Answers

  • Hi Khwaab,

    Local connections you mentioned here means "localhost"? Localhost are always unavailable in Windows Store App, take a look at the documentation: How to enable loopback and troubleshoot network isolation

    Note  Loopback is permitted only for development purposes. Usage by a Windows Runtime app installed outside of Visual Studio is not permitted. Further, a Windows Runtime app can use an IP loopback only as the target address for a client network request. So a Windows Runtime app that uses a DatagramSocket or StreamSocketListener to listen on an IP loopback address is prevented from receiving any incoming packets.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" 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.

    Wednesday, August 27, 2014 9:55 AM
    Moderator

All replies

  • Hi Khwaab,

    I moved this case to Building Windows Store apps with C# or VB forum for better response.

    Thank you for your understanding!

    Best regards,


    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.

    Wednesday, August 20, 2014 5:35 AM
  • Hi Khwaab,

    Local connections you mentioned here means "localhost"? Localhost are always unavailable in Windows Store App, take a look at the documentation: How to enable loopback and troubleshoot network isolation

    Note  Loopback is permitted only for development purposes. Usage by a Windows Runtime app installed outside of Visual Studio is not permitted. Further, a Windows Runtime app can use an IP loopback only as the target address for a client network request. So a Windows Runtime app that uses a DatagramSocket or StreamSocketListener to listen on an IP loopback address is prevented from receiving any incoming packets.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" 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.

    Wednesday, August 27, 2014 9:55 AM
    Moderator