|  | @@ -80,15 +80,8 @@ class Server(_base_server.Server):
 | 
	
		
			
				|  |  |          Returns:
 | 
	
		
			
				|  |  |            An integer port on which the server will accept RPC requests.
 | 
	
		
			
				|  |  |          """
 | 
	
		
			
				|  |  | -        port = self._server.add_insecure_port(_common.encode(address))
 | 
	
		
			
				|  |  | -        if port == 0:
 | 
	
		
			
				|  |  | -            # The Core API doesn't return a failure message. The best we can do
 | 
	
		
			
				|  |  | -            # is raising an exception to prevent further confusion.
 | 
	
		
			
				|  |  | -            raise RuntimeError('Failed to bind to address %s; set '
 | 
	
		
			
				|  |  | -                               'GRPC_VERBOSITY=debug env to see detailed error '
 | 
	
		
			
				|  |  | -                               'message.' % address)
 | 
	
		
			
				|  |  | -        else:
 | 
	
		
			
				|  |  | -            return port
 | 
	
		
			
				|  |  | +        return _common.validate_port_binding_result(
 | 
	
		
			
				|  |  | +            address, self._server.add_insecure_port(_common.encode(address)))
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      def add_secure_port(self, address: str,
 | 
	
		
			
				|  |  |                          server_credentials: grpc.ServerCredentials) -> int:
 | 
	
	
		
			
				|  | @@ -105,16 +98,10 @@ class Server(_base_server.Server):
 | 
	
		
			
				|  |  |          Returns:
 | 
	
		
			
				|  |  |            An integer port on which the server will accept RPC requests.
 | 
	
		
			
				|  |  |          """
 | 
	
		
			
				|  |  | -        port = self._server.add_secure_port(_common.encode(address),
 | 
	
		
			
				|  |  | -                                            server_credentials)
 | 
	
		
			
				|  |  | -        if port == 0:
 | 
	
		
			
				|  |  | -            # The Core API doesn't return a failure message. The best we can do
 | 
	
		
			
				|  |  | -            # is raising an exception to prevent further confusion.
 | 
	
		
			
				|  |  | -            raise RuntimeError('Failed to bind to address %s; set '
 | 
	
		
			
				|  |  | -                               'GRPC_VERBOSITY=debug env to see detailed error '
 | 
	
		
			
				|  |  | -                               'message.' % address)
 | 
	
		
			
				|  |  | -        else:
 | 
	
		
			
				|  |  | -            return port
 | 
	
		
			
				|  |  | +        return _common.validate_port_binding_result(
 | 
	
		
			
				|  |  | +            address,
 | 
	
		
			
				|  |  | +            self._server.add_secure_port(_common.encode(address),
 | 
	
		
			
				|  |  | +                                         server_credentials))
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      async def start(self) -> None:
 | 
	
		
			
				|  |  |          """Starts this Server.
 |