| 84 | return c1, c2 |
| 85 | |
| 86 | def link(self, name, max_frame=None, idle_timeout=None): |
| 87 | c1, c2 = self.connection() |
| 88 | if max_frame: |
| 89 | c1.transport.max_frame_size = max_frame[0] |
| 90 | c2.transport.max_frame_size = max_frame[1] |
| 91 | if idle_timeout: |
| 92 | # idle_timeout in seconds expressed as float |
| 93 | c1.transport.idle_timeout = idle_timeout[0] |
| 94 | c2.transport.idle_timeout = idle_timeout[1] |
| 95 | c1.open() |
| 96 | c2.open() |
| 97 | ssn1 = c1.session() |
| 98 | ssn1.open() |
| 99 | self.pump() |
| 100 | ssn2 = c2.session_head(Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_ACTIVE) |
| 101 | ssn2.open() |
| 102 | self.pump() |
| 103 | snd = ssn1.sender(name) |
| 104 | rcv = ssn2.receiver(name) |
| 105 | return snd, rcv |
| 106 | |
| 107 | def cleanup(self): |
| 108 | self._wires = [] |