<s> """<STR_LIT>""" <EOL> from socket import getaddrinfo , gaierror <EOL> class SocketConfig ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , address , base_port ) : <EOL> if address == '<STR_LIT:*>' : <EOL> self . ip_addr = '<STR_LIT:*>' <EOL> self . base_port = base_port <EOL> self . is_ipv6 = False <EOL> else : <EOL> try : <EOL> addr_tuple = getaddrinfo ( address , base_port ) [ <NUM_LIT:0> ] [ <NUM_LIT:4> ] <EOL> except gaierror : <EOL> raise gaierror ( "<STR_LIT>" % address ) <EOL> self . ip_addr = addr_tuple [ <NUM_LIT:0> ] <EOL> self . base_port = addr_tuple [ <NUM_LIT:1> ] <EOL> self . is_ipv6 = True if len ( addr_tuple ) == <NUM_LIT:4> else False <EOL> def spiders_in ( self ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT>' % ( self . ip_addr , self . base_port ) <EOL> def spiders_out ( self ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT>' % ( self . ip_addr , self . base_port + <NUM_LIT:1> ) <EOL> def sw_in ( self ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT>' % ( self . ip_addr , self . base_port + <NUM_LIT:2> ) <EOL> def sw_out ( self ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT>' % ( self . ip_addr , self . base_port + <NUM_LIT:3> ) <EOL> def db_in ( self ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT>' % ( self . ip_addr , self . base_port + <NUM_LIT:4> ) <EOL> def db_out ( self ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT>' % ( self . ip_addr , self . base_port + <NUM_LIT:5> ) </s>
