Websocket client question
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Websocket client question

  1. #1
    Join Date
    Nov 2011
    Posts
    3

    Websocket client question

    Hi,

    I'm trying to make a windows app that connects via websockets.

    I create a socket (AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP) using this example
    http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx
    and send a handshake header to the test server:

    GET / HTTP/1.1
    Host: echo.websocket.org
    Upgrade: websocket
    Connection: Upgrade
    Sec-WebSocket-Key: XbaSVjzMpuugjiIaTS1SYK8XDEE=
    Origin: http://echo.websocket.org
    Sec-WebSocket-Protocol: chat, superchat
    Sec-WebSocket-Version: 13

    In response I get a confirmation from the server:

    HTTP/1.1 101 Web Socket Protocol Handshake
    Upgrade: WebSocket
    Connection: Upgrade
    Sec-WebSocket-Accept: 3FO+JS5IVEBEOLgEjiwoLSsQfAg=
    Server: Kaazing Gateway
    Date: Tue, 10 Sep 2013 03:33:01 GMT

    immediately followed by a websocket connection close frame, so the socket connection closes right away.

    Can anyone please tell me what I might be missing here, what might cause this connection to close and how to keep it alive?

    Thank you!
    Last edited by alikim; September 11th, 2013 at 07:11 AM.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,472

    Re: Websocket client question

    Quote Originally Posted by alikim View Post
    what might cause this connection to close and how to keep it alive?
    Perhaps, you close the connection in your code?
    Victor Nijegorodov

  3. #3
    Join Date
    Nov 2011
    Posts
    3

    Re: Websocket client question

    Quote Originally Posted by VictorN View Post
    Perhaps, you close the connection in your code?
    EDIT: I figured it out.
    Last edited by alikim; September 11th, 2013 at 07:09 AM.

  4. #4
    Join Date
    Oct 2013
    Posts
    1

    Re: Websocket client question

    I'm trying to make an application in VB (or C#, but preferable VB) that deals with data from a websocket stream. I can't for the life of me get the app to connect to the stream and feed the data. If you have any simple examples I could work off it would be appreciated. Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center