IIS 7 and Above
Proper way for IIS8 nativemodule to close Websocket in C++?
Last post Apr 17, 2019 12:43 PM by svandex
Apr 22, 2014 09:25 AM|garykibble|LINK
I've figured out websocket multi-fragment read/write with a C++ nativemodule but it's not clear to me the "correct" way for the server to end a socket session. Also which server-side functions below are necessary if the client closes the websocket?
The IWebSocketContext interface has three functions for websocket closure:
Should all three be used? In what order?
Apr 30, 2014 04:38 AM|lextm|LINK
If you read MSDN documentation carefully along with WebSocket RFC,
You will see that CloseTcpConnection is exactly _Close the WebSocket Connection_ in RFC6455 7.1.1, while SendConnectionClose is 7.1.2. Disgesting the RFC document further and you will tell what's the differences and when to use which.
CancelOutstandingIO is not related to connection close both by name and its explanation on MSDN.
Apr 17, 2019 12:43 PM|svandex|LINK
I followed steps in this link: https://blogs.iis.net/jennylaw/iis-and-websockets
and I have got the IWebSocketContext pointer, but when i call ReadFragment/WriteFragment, the HRESULT is E_NOTIMPL, that means the two functions are not implemented. why happend that? do i have to set module context or do i have to do others steps before
I call ReadFragment/WriteFragement?
I write my code in OnEndRequest function. And I don't know how to make things work while i write my code in OnExcecuteRequestHandler, give me some examples?
Hope you can help me, thanks.