protected static function exceptionOnFalse($resource, callable $closure)
    {
        $result = $closure($resource);

        if ($result === false) {
            throw new SocketException($resource);
        }

        return $result;
    }
protected static function exceptionOnFalse($resource, callable $closure)
    {
        $result = $closure($resource);

        if ($result === false) {
            throw new SocketException($resource);
        }

        return $result;
    }
protected static function exceptionOnFalse ( $ resource , callable $ closure ) { $ result = $ closure ( $ resource ) ; if ( $ result === false ) { throw new SocketException ( $ resource ) ; } return $ result ; }
Performs the closure function.  If it returns false, throws a SocketException using the provided resource.

@param resource $resource Socket Resource
@param callable $closure  A function that takes 1 parameter (a socket resource)

@throws SocketException
Performs the closure function . If it returns false throws a SocketException using the provided resource .