locked
WebSocket Server on WIndows 8 Tablet RRS feed

  • Question

  • Hi,

    Does  WINRT APIs in (Windows.Networking) namespace support creating a WebSocket Server on a WIndows Tablet ?

    Thanks

    Thursday, July 18, 2013 10:08 AM

All replies

  • yes, WINRT support WebSocket server.

    In WINRT,Use the Windows.Networking.Sockets namespace provided in the Windows Runtime environment to enable your Windows Store app   to send and receive data using WebSockets for low-latency, secure, real-time bi-directional communication.

    I think you can see this article and link:

    http://msdn.microsoft.com/en-us/library/windows/apps/hh761442.aspx

    http://msdn.microsoft.com/en-us/library/windows/apps/hh994392.aspx

    Hope this helps!

    Saturday, July 20, 2013 4:03 PM
    Moderator
  • Thanks for the response.

    The provided links have support for a WebSocket client . I did not see any way to spin off a WebSocket Server in WIndows STore app.

    EVen though, the link mentions "Windows 8 provides support for both client and server use of WebSockets.", but there is no class which tells how to create a web socket server.

    Please note, I am looking at a plain HTTP based Web Socket server without depending on IIS or any other heavy servers.

    Please let me know.

    Thanks


    Monday, July 22, 2013 5:51 AM
  • Hello,

    About the websocket usage,We firstly see this example:

    http://code.msdn.microsoft.com/windowsapps/StreamSocket-Sample-8c573931

    Above this example,we can see this:

    The client component of the sample demonstrates the following features:

    • Use the StreamSocket class to create a TCP socket.
    • Make a network connection to a TCP network server using one of the StreamSocket.ConnectAsync methods.
    • Send data to the server using the Streams.DataWriter object which allows a programmer to write common types (integers and strings, for example) on any stream.

    The server component of the sample demonstrates the following features:

    When we want to create the server,we need to create the Socket listener to waiting connection and data.

    So I suggest you can get this example to try it.

    Thanks!

    Thursday, July 25, 2013 2:33 AM
    Moderator
  • There's always confusion between steam sockets and web sockets!  WebSockets are a protocol layered on top of TCP (StreamSocket); the two are often used to solve similar problems, but they aren't interchangeable.

    There's no App store app API for WebSocket listeners (or any HTTP listener, for that matter).  The only TCP-based server supported for App store apps is StreamSocketListener for TCP. (Datagram sockets can also be used for sending and receiving, but don't require special set up).


    Saturday, July 27, 2013 8:21 PM
  • Hello,

    About the websocket usage,We firstly see this example:

    http://code.msdn.microsoft.com/windowsapps/StreamSocket-Sample-8c573931

    Above this example,we can see this:

    The client component of the sample demonstrates the following features:

    • Use the StreamSocket class to create a TCP socket.
    • Make a network connection to a TCP network server using one of the StreamSocket.ConnectAsync methods.
    • Send data to the server using the Streams.DataWriter object which allows a programmer to write common types (integers and strings, for example) on any stream.

    The server component of the sample demonstrates the following features:

    When we want to create the server,we need to create the Socket listener to waiting connection and data.

    So I suggest you can get this example to try it.

    Thanks!

    Will,

    APpreciate ur response and details on this.

    I guess, as mentioned by "PeterSmith", STream sockets support (both client and server) are very much available in Windows store apps. But, the WebSockets (which is a Protocol in itself) uses is layered on top of  sockets but has a lot of protocol specific implementation to realize it.

    SO, my query was related to websockets, where I was wondering if there is any direct implementation of websocket listeners in WINdows store app APIs. There is a good libwebsocketserver.org implementation of websocket servers in public domain, but that cannot be used directly in windows store apps because that server code uses APIs that are not compatible with windows store app APIS (WINDOWS Runtime APIS).

    Thats the crux of the problem. EIther that server is to be ported with a lot of efforts to windows RT runtime or wait for Microsoft to add a websocket listener to storeapp apis... both are distant dreams :)

    Thanks anyway


    Tuesday, July 30, 2013 12:48 PM