MCPcopy Index your code
hub / github.com/python/cpython / sendeprt

Method sendeprt

Lib/ftplib.py:298–309  ·  view source on GitHub ↗

Send an EPRT command with the current host and the given port number.

(self, host, port)

Source from the content-addressed store, hash-verified

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.'''

Callers 1

makeportMethod · 0.95

Calls 3

voidcmdMethod · 0.95
error_protoClass · 0.70
joinMethod · 0.45

Tested by

no test coverage detected