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_DISCONNECTED);
ok (ZMQ::Raw->ZMQ_EVENT_MONITOR_STOPPED);
ok (ZMQ::Raw->ZMQ_EVENT_ALL);
ok (ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL);
ok (ZMQ_EVENT_HANDSHAKE_SUCCEEDED);
ok (ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL);
ok (ZMQ_EVENT_HANDSHAKE_FAILED_AUTH);

my $ctx = ZMQ::Raw::Context->new;
isa_ok ($ctx, "ZMQ::Raw::Context");

if ($^O ne 'MSWin32')
{
	# cannot be changed on Windows
	$ctx->set (ZMQ::Raw->ZMQ_MAX_SOCKETS, 1024);
}

done_testing;

