Commits

Michael Granger committed 09cf99e

In ZMQ 3, PUB sockets can't have ZMQ_IDENTITY

  • Participants
  • Parent commits a2f00dc

Comments (0)

Files changed (3)

File lib/mongrel2/connection.rb

 
 		self.log.info "Connecting PUB response socket (%s)" % [ self.pub_addr ]
 		@response_sock = ctx.socket( :PUB )
-		@response_sock.identity = self.identifier
 		@response_sock.linger = 0
 		@response_sock.connect( self.pub_addr )
 	end

File spec/mongrel2/connection_spec.rb

 
 		expect( @ctx ).to receive( :socket ).with( :PUB ).and_return( response_sock )
 		expect( response_sock ).to receive( :linger= ).with( 0 )
-		expect( response_sock ).to receive( :identity= ).with( /^[[:xdigit:]]{40}$/ )
+		expect( response_sock ).to_not receive( :identity= )
 		expect( response_sock ).to receive( :connect ).with( TEST_RECV_SPEC )
 
 		expect( @conn.request_sock ).to eq( request_sock )
 
 		before( :each ) do
 			@request_sock = double( "request socket", :linger= => nil, :connect => nil )
-			@response_sock = double( "response socket", :linger= => nil, :identity= => nil, :connect => nil )
+			@response_sock = double( "response socket", :linger= => nil, :connect => nil )
 
 			allow( @ctx ).to receive( :socket ).with( :PULL ).and_return( @request_sock )
 			allow( @ctx ).to receive( :socket ).with( :PUB ).and_return( @response_sock )
 
 		it "doesn't keep its request and response sockets when duped" do
 			request_sock2 = double( "request socket", :linger= => nil, :connect => nil )
-			response_sock2 = double( "response socket", :linger= => nil, :identity= => nil, :connect => nil )
+			response_sock2 = double( "response socket", :linger= => nil, :connect => nil )
 			allow( @ctx ).to receive( :socket ).with( :PULL ).and_return( request_sock2 )
 			allow( @ctx ).to receive( :socket ).with( :PUB ).and_return( response_sock2 )
 

File spec/mongrel2/handler_spec.rb

 	before( :each ) do
 		@ctx = double( '0mq context', close: nil )
 		@request_sock = double( "request socket", :linger= => nil, :connect => nil, :close => nil )
-		@response_sock = double( "response socket", :linger= => nil, :identity= => nil, :connect => nil, :close => nil )
+		@response_sock = double( "response socket", :linger= => nil, :connect => nil, :close => nil )
 
 		allow( @ctx ).to receive( :socket ).with( :PULL ).and_return( @request_sock )
 		allow( @ctx ).to receive( :socket ).with( :PUB ).and_return( @response_sock )