Send an EPRT command with the current host and the given port number.
(self, host, port)
| 296 | return self.voidcmd(cmd) |
| 297 | |
| 298 | def sendeprt(self, host, port): |
| 299 | '''Send an EPRT command with the current host and the given port number.''' |
| 300 | af = 0 |
| 301 | if self.af == socket.AF_INET: |
| 302 | af = 1 |
| 303 | if self.af == socket.AF_INET6: |
| 304 | af = 2 |
| 305 | if af == 0: |
| 306 | raise error_proto('unsupported address family') |
| 307 | fields = ['', repr(af), host, repr(port), ''] |
| 308 | cmd = 'EPRT ' + '|'.join(fields) |
| 309 | return self.voidcmd(cmd) |
| 310 | |
| 311 | def makeport(self): |
| 312 | '''Create a new socket and send a PORT command for it.''' |
no test coverage detected