The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

POEx::ZMQ::FFI::Context

SYNOPSIS

  # Used internally by POEx::ZMQ

DESCRIPTION

An object representing a ZeroMQ context; used internally by POEx::ZMQ.

See ZMQ::FFI for a ZeroMQ FFI implementation intended for use outside POE.

ATTRIBUTES

soname

The dynamic library name to use (see FFI::Raw).

Defaults to calling "find_soname" in POEx::ZMQ::FFI.

threads

The size of the ZeroMQ IO thread pool.

Defaults to 1.

max_sockets

The maximum number of sockets allowed on this context.

Defaults to 1023 (the ZMQ4 default).

METHODS

create_socket

  my $sock = $ctx->create_socket($type);

Returns a new POEx::ZMQ::FFI::Socket for the given type.

There is no destroy method; the ZeroMQ context is terminated when the object, and any sock created on this context, falls out of scope.

get_ctx_opt

  my $val = $ctx->get_ctx_opt( $option );

Retrieve context options.

See zmq_ctx_get(3).

set_ctx_opt

  $ctx->set_ctx_opt( $option, $value );

Set context options.

See zmq_ctx_set(3).

get_raw_context

Returns the raw context pointer, suitable for use with direct FFI::Raw calls (used internally by POEx::ZMQ::FFI::Socket objects).

get_zmq_version

  my $vstruct = $ctx->get_zmq_version;
  my $major   = $vstruct->major;
  # See POEx::ZMQ::FFI for complete method list

Returns the "get_version" in POEx::ZMQ::FFI struct-like object for the current "soname".

CONSUMES

POEx::ZMQ::FFI::Role::ErrorChecking

AUTHOR

Jon Portnoy <avenj@cobaltirc.org>

Significant portions of this code are inspired by or derived from ZMQ::FFI by Dylan Calid (CPAN: CALID).