# File lib/ffi-rzmq/context.rb, line 54
    def initialize(opts = {})
      if opts.respond_to?(:empty?)
        @io_threads = opts[:io_threads] || IO_THREADS_DFLT
        @max_sockets = opts[:max_sockets] || MAX_SOCKETS_DFLT
      else
        @io_threads = opts || 1
        @max_sockets = MAX_SOCKETS_DFLT
      end

      @context = LibZMQ.zmq_ctx_new
      ZMQ::Util.error_check 'zmq_ctx_new', (@context.nil? || @context.null?) ? -1 : 0

      rc = LibZMQ.zmq_ctx_set(@context, ZMQ::IO_THREADS, @io_threads)
      ZMQ::Util.error_check 'zmq_ctx_set', rc

      rc = LibZMQ.zmq_ctx_set(@context, ZMQ::MAX_SOCKETS, @max_sockets)
      ZMQ::Util.error_check 'zmq_ctx_set', rc

      define_finalizer
    end