Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(5)  |  Derive(0)  |  Import(5)

        def autodetect_socket_style():
    if sys.platform.find('linux') < 0:
        return 1
    else:
        try:
            with open('/proc/sys/net/ipv6/bindv6only', 'r') as f:
                dual_socket_style = int(f.read())
            return int(not dual_socket_style)
        except:
            return 0
        


src/f/r/FriendlyTorrent-HEAD/src/tornado/BitTornado/BT1/track.py   FriendlyTorrent(Download)
# Written by Bram Cohen
# see LICENSE.txt for license information
 
from BitTornado.parseargs import parseargs, formatDefinitions
from BitTornado.RawServer import RawServer, autodetect_ipv6, autodetect_socket_style
    ('ipv6_enabled', 0,
         'allow the client to connect to peers via IPv6'),
    ('ipv6_binds_v4', autodetect_socket_style(),
        'set if an IPv6 server socket will also field IPv4 connections'),
    ('socket_timeout', 15, 'timeout for closing connections'),

src/h/e/Herd-HEAD/BitTornado/BT1/track.py   Herd(Download)
# Written by Bram Cohen
# see LICENSE.txt for license information
 
from BitTornado.parseargs import parseargs, formatDefinitions
from BitTornado.RawServer import RawServer, autodetect_ipv6, autodetect_socket_style
    ('ipv6_enabled', 0,
         'allow the client to connect to peers via IPv6'),
    ('ipv6_binds_v4', autodetect_socket_style(),
        'set if an IPv6 server socket will also field IPv4 connections'),
    ('socket_timeout', 15, 'timeout for closing connections'),

src/s/w/swarm-HEAD/BitTornado/BT1/track.py   swarm(Download)
# Written by Bram Cohen
# see LICENSE.txt for license information
 
from BitTornado.parseargs import parseargs, formatDefinitions
from BitTornado.RawServer import RawServer, autodetect_ipv6, autodetect_socket_style
    ('ipv6_enabled', 0,
         'allow the client to connect to peers via IPv6'),
    ('ipv6_binds_v4', autodetect_socket_style(),
        'set if an IPv6 server socket will also field IPv4 connections'),
    ('socket_timeout', 15, 'timeout for closing connections'),

src/o/w/OwnTube-HEAD/videoportal/BitTornadoABC/BitTornado/BT1/track.py   OwnTube(Download)
# Written by Bram Cohen
# see LICENSE.txt for license information
 
from BitTornado.parseargs import parseargs, formatDefinitions
from BitTornado.RawServer import RawServer, autodetect_socket_style
    ('ipv6_enabled', 0,
         'allow the client to connect to peers via IPv6'),
    ('ipv6_binds_v4', autodetect_socket_style(),
        'set if an IPv6 server socket will also field IPv4 connections'),
    ('socket_timeout', 15, 'timeout for closing connections'),

src/b/i/BitTornado-HEAD/BitTornado/BT1/track.py   BitTornado(Download)
    to_ipv4, AddrList
from BitTornado.parseargs import parseargs, formatDefinitions
from BitTornado.RawServer import RawServer, autodetect_socket_style
from BitTornado.HTTPHandler import HTTPHandler, months
from BitTornado.parsedir import parsedir
#    ('ipv6_enabled', autodetect_ipv6(),
    ('ipv6_enabled', 0, 'allow the client to connect to peers via IPv6'),
    ('ipv6_binds_v4', autodetect_socket_style(),
     'set if an IPv6 server socket will also field IPv4 connections'),
    ('socket_timeout', 15, 'timeout for closing connections'),