Thanks for all the feedback. I added or die "$!"; to the $client=$socket->accept(); line.
I'm seeing an error now: No child processes at udplisten802.pl line 44.
What does this mean? Out of random googling, I decided to tweak it a bit. I added this:
With this code, the script runs, still throws the error about no child processes, but it keeps running though. I don't understand what the code does, but it keeps running. I'd rather fix it so it works properly. What would cause the accept() call to fail?my $con_handle = fork(); if ($con_handle) { print "Child Spawned [$con_handle]\n"; }else{ <put in the while(1) block here> }
@ Jethro, If i get a packet for a port that's not defined by a mapping, I have it report an error "Port: 1 is not defined for this host" and the script keeps running. I only get the error after I do an SSH session.
Thanks all for your help!
In reply to Re: TCP Server Exits Loop and Crashes with error
by rojmab
in thread TCP Server Exits Loop and Crashes with error
by rojmab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |