I tried using IIS 7 (as included in Windows 7) to test the FastCGI library that I am currently developing.
According to the original FastCGI specification, when an application is invoked, the stdin descriptor is replaced with a socket. By default, IIS uses a named pipe, but it can be configured to use TCP, that is, a socket.
When I try to use this socket in my test application, I get a WSAENOTSOCK error.
When I try to use a named pipe instead (after IIS reconfiguration), I run into similar problems. For example, I get ERROR_INVALID_HANDLE when I try to use PeekNamedPipe . ReadFile and WriteFile work correctly.
I assume that the problem is that this handle is inherited from the parent process, and the current process really does not know its exact type. The handle seems to be a simple file.
Does anyone encounter similar problems and know a solution / workaround? Can I somehow update the processing status of my descriptor so that the WIN32 API function accepts it as a socket / named pipe?
source share