Reliability of NetworkServerEvent()

Everything else that doesn't fall into one of the other PB categories.
swhite
Addict
Addict
Posts: 808
Joined: Thu May 21, 2009 6:56 pm

Reliability of NetworkServerEvent()

Post 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
Simon White
dCipher Computing
User avatar
HeX0R
Addict
Addict
Posts: 1258
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: Reliability of NetworkServerEvent()

Post 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?
benubi
Enthusiast
Enthusiast
Posts: 254
Joined: Tue Mar 29, 2005 4:01 pm

Re: Reliability of NetworkServerEvent()

Post 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
swhite
Addict
Addict
Posts: 808
Joined: Thu May 21, 2009 6:56 pm

Re: Reliability of NetworkServerEvent()

Post 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
Simon White
dCipher Computing
Post Reply