in reply to POE Help

1: When you disconnect from this program without doing a proper disconnect ie: pulling your network cable from the computer, I get an error stating "can not put on undefined value at line 117". Instead of this error how can I get it to gracefully kill that connection? Could I put a "or" goto the error subroutine after the put?

I'm guessing you get the error because the client's already been cleaned up somewhere. You could do

$heap->{client}->put($message) if defined $heap->{client};
I'm guessing cleanup is already in progress at that stage, so if you just avoid the put, the app would probably exit soon anyhow.

If that doesn't do it, you can exit yourself if !defined $heap->{client}.

2: Is there any way I can change how much data POE reads at any one time dynamically so that I can play with the data and send it out to the client?

I think you can set a ClientInputFilter on your TCP server to "chunk" the data yourself, but I'm not sure. Check out POE::Filter::Block.


Mike

Replies are listed 'Best First'.
Re^2: POE Help
by Anonymous Monk on Jul 07, 2004 at 22:09 UTC
    Well thanks for the help but it still crashes...

    I am beginning to hate POE. HELPPPPP please

      Please clarify. Are you still receiving "can not put on undefined value at line 117" when you replace that line with the one Mike suggested? Namely:

      $heap->{client}->put($message) if defined $heap->{client};

      I find this hard to believe, but stranger things have happened.

      -- Rocco Caputo - http://poe.perl.org/

Re^2: POE Help
by Anonymous Monk on Jul 07, 2004 at 14:08 UTC
    Thanks for the information. I took a look at the Filter::Block and see what it says about the data chunks.