def socket type
      sock = nil
      begin
        sock = Socket.new @context, type
      rescue ContextError => e
        sock = nil
      end
      
      sock
    end
def socket type
      sock = nil
      begin
        sock = Socket.new @context, type
      rescue ContextError => e
        sock = nil
      end
      
      sock
    end
Allocates a socket for context

 @param [Constant] type
   One of @XS::REQ@, @XS::REP@, @XS::PUB@, @XS::SUB@, @XS::PAIR@,
          @XS::PULL@, @XS::PUSH@, @XS::DEALER@, or @XS::ROUTER@

 @return [Socket] when the allocation succeeds
 @return nil when call fails