none
.NET 4.0 tcplistener not working in Windows 8 RRS feed

  • Question

  • I have a WPF application developed in .NET 4.0 that is using windows sockets and a tcplistener to allow some remote control features. I am testing on Windows 8 and find that the listener is not receiving anything that comes in. I see the StreamSocket class for 4.5, but it says this will not be compatible with Windows 7. Do I have to have a fork here or is there any way I can have a version that will run on both win 7 and 8?
    Tuesday, March 12, 2013 6:17 PM

Answers

  • Hi Dave,

    I'd check with somebody actually familiar with tcplistener. In general desktop apps work the same on Windows 8 as on Windows 7, but it's possible that there is something different here.

    The Windows Store apps Forums are specifically about writing Windows Store apps and don't cover writing desktop apps.

    I'll see if I can find a more appropriate forum for you. Since this is about the networking layer rather the UI layer I think the Windows Communication Foundation, Serialization, and Networking will be the best fit, but it's possible that they may redirect you.

    --Rob

    Wednesday, March 13, 2013 8:18 PM

All replies

  • Are you writing a Windows Store app or a desktop (WPF) app?

    As you note, the Windows Runtime (including Windows.Networking.StreamSocket) is Windows 8 only, but the full .Net framework profile (including TcpListener) should be essentially the same for desktop apps on all OSes.

    If you want to share code between a Windows Store app and a desktop app then take a look at Portable Class Libraries for the .Net code which will run in each and then call out to platform specific libraries for things which need to be done differently. The Maximize code reuse between Windows Phone 8 and Windows 8 documentation targets sharing code between Windows Store apps and Windows Phone apps, but most of the concepts are valid for sharing with desktop apps as well.

    --Rob

    Tuesday, March 12, 2013 6:41 PM
  • Thanks for the reply Rob. I am just trying to run a desktop/WPF app. I took my 4.0 based application and tried to run it on windows 8. I found the tcplistener was not receiving communications from my server, however after running wireshark, I see the traffic is coming in. I disabled firewalls and ruled anything else obvious out. The listener and sockets work in windows 7, but not windows 8. This is as far as I have gone. So the tcplistener should work in a win 8 desktop app using .net framework 4.5?
    Wednesday, March 13, 2013 5:30 AM
  • Hi Dave,

    I'd check with somebody actually familiar with tcplistener. In general desktop apps work the same on Windows 8 as on Windows 7, but it's possible that there is something different here.

    The Windows Store apps Forums are specifically about writing Windows Store apps and don't cover writing desktop apps.

    I'll see if I can find a more appropriate forum for you. Since this is about the networking layer rather the UI layer I think the Windows Communication Foundation, Serialization, and Networking will be the best fit, but it's possible that they may redirect you.

    --Rob

    Wednesday, March 13, 2013 8:18 PM
  • Thank you, I have posted a new thread in the networking forum. 
    Wednesday, March 13, 2013 8:36 PM