🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
4 messages
4 total messages Started by Lesley Anne Mon, 02 Aug 2004 15:23
Unable to re-set Active property of TIdUDPServer
#5539
Author: Lesley Anne
Date: Mon, 02 Aug 2004 15:23
37 lines
3147 bytes
I have a server application that listens for customer queries coming in
over IP (both TCP and UDP), checks databases, and then sends back an
answer.  Occasionally there are times (like when it loses connectivity
to a remote database, or when doing admin/maintenance on a local
database) when the application needs to temporarily close those server
ports in order to force clients over to an alternate site running
another instance of the application.  Then when the situation is back to
normal, it needs to re-open the server ports.

This works fine for TCP (using a TServerSocket component and its Close
and Open methods), but now we're adding UDP access to the application,
and I've found that once the UDP socket is closed, the application can't
re-start it.  I'm using a TIdUDPServer component (from the Indy
components that came with Builder 6).  I've tried setting its Active
property false and then true again.  Setting it false works and we stop
receiving the incoming UDP packets, but then when we set it back to true
we should start seeing the incoming packets again but never do.
(Setting Active to true is in a try-catch block, but no exception is
raised.)  The only way we've found to recover the UDP server socket is
to manually shut down the whole application and then re-start it, which
is not a viable solution.

I've now tried a partial solution where instead of disabling and then
re-enabling the component, I simply set a global variable that tells the
application to temporarily ignore incoming UDP messages and not respond
to them.  This works fine for instances where the application has
explicitly shut down UDP access, but we've now found that there are some
instances (usually when we have a lot of traffic and the PC gets busy
for a while) that we seem to lose the UDP port even without having
explicitly told it to stop listening.  These instances are more
problematic.  We've already established that the application doesn't
seem to be able to re-set the UDP port, so how can I make it recover
from these cases when it stops receiving the UDP packets which are being
sent to it?  (And what's really happening here anyway?  Why does the UDP
port seem to just go away like that?)

Lesley Anne
Re: Unable to re-set Active property of TIdUDPServer
#5546
Author: Lesley Anne
Date: Tue, 03 Aug 2004 17:53
54 lines
3583 bytes
OK, if no one knows what's going on here and why I keep losing the UDP
access, is there at least some way of re-setting a UDP port.  I'd settle
for a way to recover from the problem even if I can't understand or
prevent it.


I wrote:
> I have a server application that listens for customer queries coming
in
> over IP (both TCP and UDP), checks databases, and then sends back
> an answer.  Occasionally there are times (like when it loses
connectivity
> to a remote database, or when doing admin/maintenance on a local
> database) when the application needs to temporarily close those server
> ports in order to force clients over to an alternate site running
> another instance of the application.  Then when the situation is back
to
> normal, it needs to re-open the server ports.
>
> This works fine for TCP (using a TServerSocket component and its
> Close and Open methods), but now we're adding UDP access to the
> application, and I've found that once the UDP socket is closed, the
> application can't re-start it.  I'm using a TIdUDPServer component
> (from the Indy components that came with Builder 6).  I've tried
setting
> its Active property false and then true again.  Setting it false works
and
> we stop receiving the incoming UDP packets, but then when we set it
> back to true we should start seeing the incoming packets again but
> never do. (Setting Active to true is in a try-catch block, but no
exception
> is raised.)  The only way we've found to recover the UDP server socket
> is to manually shut down the whole application and then re-start it,
which
> is not a viable solution.
>
> I've now tried a partial solution where instead of disabling and then
> re-enabling the component, I simply set a global variable that tells
the
> application to temporarily ignore incoming UDP messages and not
> respond to them.  This works fine for instances where the application
has
> explicitly shut down UDP access, but we've now found that there are
> some instances (usually when we have a lot of traffic and the PC gets
busy
> for a while) that we seem to lose the UDP port even without having
> explicitly told it to stop listening.  These instances are more
> problematic.  We've already established that the application doesn't
> seem to be able to re-set the UDP port, so how can I make it recover
> from these cases when it stops receiving the UDP packets which are
> being sent to it?  (And what's really happening here anyway?  Why
> does the UDP port seem to just go away like that?)
>
> Lesley Anne
Re: Unable to re-set Active property of TIdUDPServer
#5547
Author: Remy Lebeau (TeamB)
Date: Tue, 03 Aug 2004 17:56
13 lines
1430 bytes
"Lesley Anne" <labaker@snetnsa.REMOVE-THIS-BIT.com> wrote in message
news:410e5bb3$1@newsgroups.borland.com...

> I'm using a TIdUDPServer component (from the Indy
> components that came with Builder 6).

If you are using the version that ships with BCB6, then you are using a very
old version, and should upgrade to the latest snapshot version from Indy's
website (http://www.indyproject.org).


Gambit
Re: Unable to re-set Active property of TIdUDPServer
#5558
Author: Lesley Anne
Date: Thu, 05 Aug 2004 14:32
14 lines
1520 bytes
"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> wrote
> "Lesley Anne" <labaker@snetnsa.REMOVE-THIS-BIT.com> wrote:
>
> > I'm using a TIdUDPServer component (from the Indy
> > components that came with Builder 6).
>
> If you are using the version that ships with BCB6, then you are using
> a very old version, and should upgrade to the latest snapshot version
> from Indy's website (http://www.indyproject.org).
>
> Gambit

Thanks.  I'm running Indy 9 now and it seems to be a lot more stable.
That seems to have taken care of the problem (whatever it was).
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads