I have a service running on WinNT 4 that serves the wireless connection for hand-held devices in retail stores. Recently, I changed the service to handle all communications for the client itself rather than spawining child processes to do the work. When a client connects on the socket, I use DuplicateHandle( ) to create a new handle to the same socket and pass it to a child thread that does the database work and returns the reply to the client. When CreateThread( ) succeeds, the parent (service) thread closes the handle that it has. Intermittenly (less that 5% of the time) the server send( ) returns errror 10038 (socket operation on non-socket). The handle to the socket is lost and the client which is blocking on the recv( ) appears to be hung.
Any suggestions?
Thanks in advance.
Any suggestions?
Thanks in advance.