locked
ControlChannelTrigger and WinSock

    Question

  • Hi,

    We have a large code base which uses WinSock calls and these appear to be available to runtime apps (as highlighted here: http://msdn.microsoft.com/en-us/library/windows/apps/dn424765.aspx).  Great news.

    However we also would like our app to have a long-lived network connection so I've been looking into using ControlChannelTrigger.  This would appear to be what we want to talk to a legacy server, albeit with the requirement that the user approves our app for the lock screen.

    So is it possible to use ControlChannelTrigger and old-style sockets? ControlChannelTrigger only appears to take StreamSockets or IXMLHTTPRequest (our socket communication isn't HTTP based).

    If not has anyone else solved this issue?

    All help greatly appreciated.

    Thanks

    Monday, September 08, 2014 2:39 PM

Answers

  • No, you cannot use winsock API with ControlChannelTrigger. In fact, you can only use the Windows Runtime Networking API that is available in the Windows.Networking.Sockets namespace. For example: StreamSocket for TCP Socket and DatagramSocket for UDP socket.

    The Desktop Winsock functionality cannot be used in Windows Runtime apps. See the documentation for socket/connect/send/recv/closesocket and notice that it says "Desktop apps only"


    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    • Marked as answer by SpecWin Tuesday, September 09, 2014 8:16 AM
    Monday, September 08, 2014 11:27 PM
    Moderator