Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Nov : Re: TidUDPServer
| Subject: | Re: TidUDPServer |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Fri, 2 Nov 2007 17:49:39 |
"GannTrader" <Gann_Trader@hotmail.com> wrote in message
news:472bb4f8$1@newsgroups.borland.com...
> What is the proper way to close a UDPServer?
Simply set its Active property to false.
> When trying UDPServer.active:=false i get socket error 10004.
I doubt that. That error code is only reported when WSACancelBlockingCall()
is called on a blocked socket, and Indy does not use that function at all.
Besides that, TIdUDPServer is a multi-threaded component. Closing the
server disconnects all active sockets and terminates their threads. If such
an error were occuring, it is likely happening inside the context of those
threads, not the thread that is deactivating the server. In which case,
TIdUDPServer will automatically handle the error internally for you. The
only time you would ever see it is if you are running your project inside
the IDE's debugger.
Gambit