in reply to Re^7: two-way socket works once only?
in thread two-way socket works once only?

Yes, LocalPort => '127.0.0.1' is a typo for LocalAddr => '127.0.0.1'. The latter means only accept connections from 127.0.0.1. (Actaully, it means listen for connections whose destination address is 127.0.0.1, which should mean the same thing.) I used that for testing.

while (defined($incoming = <$client_sock>)) can indeed be simplified to while ($incoming = <$client_sock>). Old habbit. It's not needed here, and it's not needed when doing while (defined($line = <$fh>)), where I picked up the habbit.

Yes, if (0) is just an easy way to comment out a section. I didn't have a header file.

Replies are listed 'Best First'.
Re^9: two-way socket works once only?
by wolfger (Deacon) on Nov 29, 2004 at 20:09 UTC
    Okay, thanks for the explanations. Seems that I basically was hanging things up with my client, and thinking that the problem was with my server. It's all sorted out now, and works like a charm. I cleaned up my code a bit, too... threw some things into subroutines, and quit calling a long list of "my" at the beginning (which even I thought was ugly). I'll provide the "finished" versions if anybody cares to see how it wound up.

    --
    Linux, sci-fi, and Nat Torkington, all at Penguicon 3.0