Page 1 of 1

Reliability of NetworkServerEvent()

Posted: Sat Jun 18, 2011 3:27 am
by swhite
Hi

I a created a windows NT Service that uses NetworkServerEvent() to process data sent via TCP/IP to my server. It works very nicely but today the equipment kept reporting that it could not make a network connection. The service was running, the Internet was working and there were no errors in my log but NetworkServerEvent() was not issuing any events. So I stopped and re-started the service and immediately NetworkServerEvent() started issuing events. So my question what might cause NetworkServerEvent() not to issue events? Does anyone have any experience with this function being unreliable on the Windows Server 2003 platform.

I am just looking for ideas that might explain why no events were being received.

Thanks,
Simon

Re: Reliability of NetworkServerEvent()

Posted: Sat Jun 18, 2011 7:24 pm
by HeX0R
I never saw such an effect, so i guess it has something to do with your code.
Maybe you closed the server somewhere by accident?

Re: Reliability of NetworkServerEvent()

Posted: Mon Jun 20, 2011 8:10 am
by benubi
Hello,
I am not sure but I think it could be that you re-created the server without closing it before. I noticed something like that a few years ago by accident. If you CreateServer on an already existing one, you will get an error (zero as result), and the original port in your app may be closed.
Secondly, I don“t know much about programing nt services, but I think you have to indicate the dependencies to other services; maybe there is a link missing to the "network service" and after a hibernation/standby the handles or links are not perfectly rebuilt (?) ... Your service maybe tries to use the network before it is ready for use, or the handles are not rebuilt after the "network service" is restarted.
I hope it helps you to find the bug.

Ben

Re: Reliability of NetworkServerEvent()

Posted: Mon Jun 20, 2011 2:10 pm
by swhite
Thanks for the responses. I had not thought about the possibility of dependencies that might affect my service so I will look into some of these.

Simon