I think I did not explain my problem correctly.

I have a poe script/server that has both a:

POE::Component::Client::TCP and a POE::Component::Server::TCP

The idea is the Client::TCP connects to a stock quote server somewhere else
on the network.  The Server::TCP lets local clients connect to it.  I'd like
to prevent the local clients from connecting (or shut down the Server::TCP
completely) when the quote server is unavailable.

Though in writing this email I think I figured out how to do it:

when the quote server is down, I send a message to the Server::TCP to shut
down
When the quote server comes up, and I get a connected event, I'll create a
Server::TCP

Thanks
Jay



----- Original Message -----
From: "Rocco Caputo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 06, 2004 6:56 AM
Subject: Re: Preventing connections with POE::Component::Server::TCP


> On Fri, Mar 05, 2004 at 10:49:03PM -0600, Jay Strauss wrote:
> >
> > I have a POE::Component::Server::TCP.  I'd like to prevent connections
under
> > certain circumstances, even though I'm still in the event loop.  Is
there a
> > way to do this?  That is I want my program to run, I just don't want to
> > allow connections at certain times.
>
> Not as far as I know.
>
> The problem: accept() returns the remote address, so the connection
> must be accepted before you can decide whether the client should
> connect.  By that time the client HAS connected, and the best you can
> do is hang up on it right away.
>
> You can tweak your firewall if you know your "certain circumstances"
> ahead of time.
>
> --
> Rocco Caputo - [EMAIL PROTECTED] - http://poe.perl.org/
>
>

Reply via email to