# When the client goes away, terminate the current process # and also kill the mysql query that is running on the server. my $watch= watch_socket( socket => $socket, event => EVENT_EOF|EVENT_EPIPE, actions => [ [ run => 'mysql', -e => "kill $id" ], [ kill => $$, SIGKILL ], ] );