Explorar o código

Why does send() die()?

Zachary Kotlarek %!s(int64=12) %!d(string=hai) anos
pai
achega
aeb6007fe0
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      dmx/state.pl

+ 1 - 2
dmx/state.pl

@@ -678,8 +678,7 @@ while (1) {
 		foreach my $sub (@subscribers) {
 
 			# Drop subscribers that are not available
-			my $send = $sub->{'socket'}->send($msg);
-			if (!defined($send) || $send < 1) {
+			if (!eval { $sub->{'socket'}->send($state . $status) }) {
 				print STDERR 'Dropping bad socket from subscriber list: ' . $sub->{'path'} . "\n";
 
 				my @new_subscribers = ();