testing ISAPI Ext. on Win XP Pro Sp2 IIS 5 RRS feed

  • Question

  • User237014454 posted

    dear all,

     i'm working on developing an extension for the purpose of some long-timed requests, so after writing the main blocks of the code using VC++6.0 + MFC that includes a separate thread pool & some shared datastructures with simple sync mechanism, my test is as follows:

    1- return HSE_STATUS_PENDING to the server

    2- pass pCtxt to my thread pool

    3- threadpool will check periodically for active connections, and when a connection reaches a certain time (eg: 30 sec- 2 min) it uses writeclient() for sending reply then it call ServerSupportFunction() with HSE_REQ_DONE_WITH_SESSION and removes pCtxt from my active conn.(s)' list

    4- the client that i used for testing do open multiple connections requesting ext.'s dll from the server, so i can detect number of simaltenious conn.(s)

    but i found something strange, the client can only have 2 simalt. conn.(s) active with iis at a time, and any new request come from the same ip, the iis reuse one of the 2 active conn.(s)' connID to be used with it, even i think it leaves all the sockets opening (old and new) but reuse connID which is used by writeclient(), so in my test, the last 2 conn.(s) recieved all the sent data of the opened connections.

    if this is a limitation of win xp iis, so how could this operate if the requests are coming from behind nat or proxy.

    another question is about async callbacks, if i used async writeclient() for example, can i access any shared data inside dll from it or i can use only pECB's included functions pointers (as callback is not running actually in my dll ??), seems no for me (accessing shared data failed) !!!, and how could i use the pContext arg of callback, should i pass the pCtxt first when i call ServerSupportFunction() with HSE_REQ_IO_COMPLETION as the last parameter.


    with regards

    ibrahim shahin

    3rd year Computer Engineering, ASU, Egypt

    Thursday, January 10, 2008 1:17 PM


  • User511787461 posted

    There is no IIS restriction to only allow 2 consecutive requests - maybe, your client has that restriction?  (I believe WinInet has it to prevent DoS'ing a server).  Also, maybe you are completely the requests too quickly to ever accumulate more than 2 requests - can you put a delay between queueing the requests and picking it up in the threadpool?

    You can use any valid memory for async WriteClient - it must remain valid until the completion fires.

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Monday, January 14, 2008 8:14 PM