OLD | NEW |
| (Empty) |
1 # Copyright (c) 2001-2004 Twisted Matrix Laboratories. | |
2 # See LICENSE for details. | |
3 | |
4 # | |
5 import direct, unix | |
6 | |
7 connectTypes = {"direct" : direct.connect, | |
8 "unix" : unix.connect} | |
9 | |
10 def connect(host, port, options, verifyHostKey, userAuthObject): | |
11 useConnects = options.conns or ['unix', 'direct'] | |
12 return _ebConnect(None, useConnects, host, port, options, verifyHostKey, | |
13 userAuthObject) | |
14 | |
15 def _ebConnect(f, useConnects, host, port, options, vhk, uao): | |
16 if not useConnects: | |
17 return f | |
18 connectType = useConnects.pop(0) | |
19 f = connectTypes[connectType] | |
20 d = f(host, port, options, vhk, uao) | |
21 d.addErrback(_ebConnect, useConnects, host, port, options, vhk, uao) | |
22 return d | |
OLD | NEW |