closesocket() on inherited sockets under Windows 95 not giving close notification?

closesocket() on inherited sockets under Windows 95 not giving close notification?

Post by Ian Hegert » Mon, 26 Aug 1996 04:00:00



Microsoft has in it's knowledge base an article about a bug in Windows
95 where sockets cannot be transferred to child processes. It gives
a work around where DuplicateHandle() is used to create an inheritable
socket, so the process looks like this:

Main Process()
  ... get socket
  DuplicateHandle() to get an inheritable socket
  CreateProcess() passing the socket value on the cmd line....
  closesocket() original socket
  closesocket() out view odf the duplicate()

Child Process()
  ... get socket from command line...
  .... do things with it...

In my child process I'm doing a closesocket() on the handle but no
close notification is being received by the other end of the socket -
I suspect this this an essential problem with Windows 95 sockets,  but
does anyone have a workaround? I call WSAStartup() (as I presume I must)
in both apps.

TIA, Ian

--

If you could fool all the people all the time how would we know?