anchor.diff:    }
   
     //TODO yuck - this needs a rewrite.
  -  static Future<SecureSocket> _connectSsl(
  -      Settings settings, Duration timeout, onTimeout()) {
  +  static Future<SecureSocket> _connectSsl(Future<Socket> future) {
   
       var completer = new Completer<SecureSocket>();
   
  -    Socket.connect(settings.host, settings.port).then((socket) {
  +    future.then((socket) {
   
         socket.listen((data) {
           if (data == null || data[0] != _S) {
  
positive.code:           () => throw new TimeoutException(
                'Postgresql connection timed out. $timeout', timeout);
        
        var future = settings.requireSsl
          ? _connectSsl(settings, timeout, onTimeout)
          : Socket.connect(settings.host, settings.port)
              .timeout(timeout, onTimeout: onTimeout);
  
        return future.then((socket) {
          var conn = new ConnectionImpl(socket, settings, typeConverter);
          socket.listen(conn._readData, 
              onError: conn._handleSocketError,
  
negative.code: 
    final StreamController _messages = new StreamController.broadcast();
  
    static Future<ConnectionImpl> connect(
        String uri,
        Duration timeout, 
        TypeConverter typeConverter,
        {Socket mockSocketConnect(String host, int port)}) {
      return new Future.sync(() {
        
        var settings = new Settings.fromUri(uri);
  
        //FIXME Currently this timeout doesn't cancel the socket connection 
  