phimtau123 has asked for the wisdom of the Perl Monks concerning the following question:
Now if i comment out the "my $status=Socket" it work perfectly. and it not commend out sometime the notifcation would work other it cause the service to stop. Any Idea on what might be causing the problem?foreach my $filename ( readdir( DIR ) ) { my $filepath = "$scan_dir\\$filename"; if ( $filename =~ /\.txt$/i ) { my ($variable)=Read_File( $scan_dir, $filename ); Scan_File($variables); my $status=Socket($variable,$sock); } else { # get rid id miscellanous files in this directory unlink "$scan_dir\\$filename" or print ERROR "can't unl +ink $scan_dir\\$filename $!"; } }
This is my socket subsub Socket { my ($variable, $sock)=@_; if ($alarmtype =~ "WARNING") { $alarmtype = "NOTIFICATION"; } elsif ($alarmtype =~ "HALT") { $alarmtype = "SHUTDOWN"; } my $msg= "$alarmtype\r\n$eqpid\r\n$eqpid-$chamber\r\nMW\r\nTriant +Parameter Out of Bound. \r\nTCOM:\r\nN\r\nAlarmType='$alarmtype' $sen +sor on recipe $recipe is out of bound. Signal_Level = $signal_level L +ower = $alarm_lower_limit Upper = $alarm_upper_limit Code = $code \r\ +nI\r\nSTOP\r\nPHOT\r\n"; sendToLog ("TCOM socket: $msg") ; $sock->send($msg ); return ("TRUE"); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Socket Problem
by chrism01 (Friar) on Jun 21, 2007 at 01:42 UTC | |
by phimtau123 (Novice) on Jun 21, 2007 at 15:49 UTC |