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
Reliability of NetworkServerEvent()
Reliability of NetworkServerEvent()
Simon White
dCipher Computing
dCipher Computing
Re: Reliability of NetworkServerEvent()
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?
Maybe you closed the server somewhere by accident?
{Home}.:|:.{Dialog Design0R}.:|:.{Codes}.:|:.{History Viewer Online}.:|:.{Send a Beer}
Re: Reliability of NetworkServerEvent()
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
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()
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
Simon White
dCipher Computing
dCipher Computing

