in reply to Re^2: SIGHUP with Proc::Daemon
in thread SIGHUP with Proc::Daemon
#!/usr/bin/perl use common::sense; use ZeroMQ ':all'; use Data::Dumper; my $ctx = ZeroMQ::Context->new(); my $sock = $ctx->socket(ZMQ_PULL); $sock->setsockopt(ZMQ_HWM, 500); $sock->bind('tcp://*:5558'); $SIG{HUP} = sub { print "got hup\n"; }; while (1) { my $msg = $sock->recv(); print "got message\n"; print Dumper(\$msg); }
got hup got message $VAR1 = \undef;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: SIGHUP with Proc::Daemon
by Eliya (Vicar) on Mar 09, 2012 at 19:56 UTC |