def connect(self):
if ("<STR_LIT>" in os.environ) and (sys.platform != "<STR_LIT:win32>"):<EOL><INDENT>conn = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)<EOL>try:<EOL><INDENT>retry_on_signal(<EOL>lambda: conn.connect(os.environ["<STR_LIT>"])<EOL>)<EOL><DEDENT>except:<EOL><INDENT>return<EOL><DEDENT><DEDENT>elif sys.platform == "<STR_LIT:win32>":<EOL><INDENT>import paramiko.win_pageant as win_pageant<EOL>if win_pageant.can_talk_to_agent():<EOL><INDENT>conn = win_pageant.PageantConnection()<EOL><DEDENT>else:<EOL><INDENT>return<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return<EOL><DEDENT>self._conn = conn<EOL>
Method automatically called by ``AgentProxyThread.run``.