mirror of
				https://github.com/zeromq/libzmq.git
				synced 2025-10-30 05:29:43 +01:00 
			
		
		
		
	PLAIN: Small simplification
This commit is contained in:
		| @@ -30,7 +30,6 @@ | |||||||
|  |  | ||||||
| zmq::plain_client_t::plain_client_t (const options_t &options_) : | zmq::plain_client_t::plain_client_t (const options_t &options_) : | ||||||
|     mechanism_t (options_), |     mechanism_t (options_), | ||||||
|     error_command_received (false), |  | ||||||
|     state (sending_hello) |     state (sending_hello) | ||||||
| { | { | ||||||
| } | } | ||||||
| @@ -98,7 +97,7 @@ zmq::mechanism_t::status_t zmq::plain_client_t::status () const | |||||||
|     if (state == ready) |     if (state == ready) | ||||||
|         return mechanism_t::ready; |         return mechanism_t::ready; | ||||||
|     else |     else | ||||||
|     if (error_command_received) |     if (state == error_command_received) | ||||||
|         return mechanism_t::error; |         return mechanism_t::error; | ||||||
|     else |     else | ||||||
|         return mechanism_t::handshaking; |         return mechanism_t::handshaking; | ||||||
| @@ -208,6 +207,6 @@ int zmq::plain_client_t::process_error ( | |||||||
|         errno = EPROTO; |         errno = EPROTO; | ||||||
|         return -1; |         return -1; | ||||||
|     } |     } | ||||||
|     error_command_received = true; |     state = error_command_received; | ||||||
|     return 0; |     return 0; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -42,13 +42,12 @@ namespace zmq | |||||||
|  |  | ||||||
|     private: |     private: | ||||||
|  |  | ||||||
|         bool error_command_received; |  | ||||||
|  |  | ||||||
|         enum state_t { |         enum state_t { | ||||||
|             sending_hello, |             sending_hello, | ||||||
|             waiting_for_welcome, |             waiting_for_welcome, | ||||||
|             sending_initiate, |             sending_initiate, | ||||||
|             waiting_for_ready, |             waiting_for_ready, | ||||||
|  |             error_command_received, | ||||||
|             ready |             ready | ||||||
|         }; |         }; | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Martin Hurton
					Martin Hurton