private void getConnectionNoRouterInfo(GetConnectionCallback callback) { if(_endpoints.Length > 0) { createConnection(_endpoints, callback); return; } if(_locatorInfo != null) { _locatorInfo.getEndpoints(this, _locatorCacheTimeout, new LocatorEndpointsCallback(this, callback)); } else { callback.setException(new Ice.NoEndpointException(ToString())); } }
public override void getConnection(GetConnectionCallback callback) { try { bool compress; Ice.ConnectionI connection = getConnection(out compress); callback.setConnection(connection, compress); } catch(Ice.LocalException ex) { callback.setException(ex); } }
protected void createConnection(EndpointI[] allEndpoints, GetConnectionCallback callback) { EndpointI[] endpoints = filterEndpoints(allEndpoints); if(endpoints.Length == 0) { callback.setException(new Ice.NoEndpointException(ToString())); return; } // // Finally, create the connection. // OutgoingConnectionFactory factory = getInstance().outgoingConnectionFactory(); if(getCacheConnection() || endpoints.Length == 1) { // // Get an existing connection or create one if there's no // existing connection to one of the given endpoints. // factory.create(endpoints, false, getEndpointSelection(), new CreateConnectionCallback(this, null, callback)); } else { // // Go through the list of endpoints and try to create the // connection until it succeeds. This is different from just // calling create() with the given endpoints since this might // create a new connection even if there's an existing // connection for one of the endpoints. // factory.create(new EndpointI[]{ endpoints[0] }, true, getEndpointSelection(), new CreateConnectionCallback(this, endpoints, callback)); } }