CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2005
    Posts
    1,828

    Problem with WinHTTP Socket Application

    I am running this WinHTTP-WebSocket Application in a Windows 8.1 platform with Visual Studio 2013.

    http://code.msdn.microsoft.com/windo...a140b5#content.

    But while running this application, I come across Error 12029 which is generated while calling WinHttpSendRequest function.

    Can someone tell me a solution to this?

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Problem with WinHTTP Socket Application

    I'd like to inform you that there is MSDN (Microsoft Developer Network) that contains also the information about API possible error codes and descriptions. Didn't you know about it?
    Then (just for you!):
    Error Messages
    The error values listed below are returned by GetLastError when one of the Microsoft Windows HTTP Services (WinHTTP) functions fails, and are also returned in the lower 16 bits of HRESULT error returns from the WinHttpRequest object.
    Error values whose names begin with "ERROR_WINHTTP_" are specific to the WinHTTP functions. The WinHTTP functions also return Windows error messages where appropriate.
    ....
    ERROR_WINHTTP_CANNOT_CONNECT
    12029
    Returned if connection to the server failed.
    Victor Nijegorodov

  3. #3
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

  4. #4
    Join Date
    Apr 2005
    Posts
    1,828

    Re: Problem with WinHTTP Socket Application

    OK I was able to resolve that error by installing IIS Server from Add Remove program now I am coming Error Code 4317 with WinHttpWebSocketCompleteUpgrade function. Can someone tell me a solution to this?

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Problem with WinHTTP Socket Application

    From MSDN:
    Remarks

    WinHttpWebSocketCompleteUpgrade can be called on an open HTTP request to get a WebSocket handle for performing other WebSocket operations.
    The request handle must be marked as a WebSocket upgrade by calling WinHttpSetOption with WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET before sending the request.

    The caller should check the HTTP status code returned by the server and call this function only if the status code was 101. Calling it with any other status code will result in a failure.
    So, did you call WinHttpSetOption with WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET before sending the request?
    Did you check the HTTP status code returned by the server? Was it 101?
    Victor Nijegorodov

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured