def initialize context_ptr, type, opts = {:receiver_class => ZMQ::Message}
@receiver_klass = opts[:receiver_class]
context_ptr = context_ptr.pointer if context_ptr.kind_of?(ZMQ::Context)
if context_ptr.nil? || context_ptr.null?
raise ContextError.new 'zmq_socket', 0, ETERM, "Context pointer was null"
else
@socket = LibZMQ.zmq_socket context_ptr, type
if @socket && !@socket.null?
@name = SocketTypeNameMap[type]
else
raise ContextError.new 'zmq_socket', 0, ETERM, "Socket pointer was null"
end
end
@longlong_cache = @int_cache = nil
@more_parts_array = []
@option_lookup = []
populate_option_lookup
define_finalizer
end