MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / create_connection

Function create_connection

thirdparty/socks/socks.py:397–413  ·  view source on GitHub ↗
(address, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                    source_address=None)

Source from the content-addressed store, hash-verified

395 raise GeneralProxyError((4, _generalerrors[4]))
396
397def create_connection(address, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
398 source_address=None):
399 # Patched for a DNS-leakage
400 host, port = address
401 sock = None
402 try:
403 sock = socksocket(socket.AF_INET, socket.SOCK_STREAM)
404 if timeout is not socket._GLOBAL_DEFAULT_TIMEOUT:
405 sock.settimeout(timeout)
406 if source_address:
407 sock.bind(source_address)
408 sock.connect(address)
409 except socket.error:
410 if sock is not None:
411 sock.close()
412 raise
413 return sock

Callers

nothing calls this directly

Calls 3

socksocketClass · 0.85
connectMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…