
    "e                         d dl mZ d dlZej                  j	                  d      dk7  Zdad Zd	dZd	dZ	e
dk(  r e e	              yy)
    )socketNjavac                      t         M	 t        j                  ddddt        j                        D ]  } | d   }|d   dk(  sda t         c S  	 da t         S t         S #  da Y t         S xY w)a(  
    Should return 127.0.0.1 in ipv4 and ::1 in ipv6

    localhost is not used because on windows vista/windows 7, there can be issues where the resolving doesn't work
    properly and takes a lot of time (had this issue on the pyunit server).

    Using the IP directly solves the problem.
    	localhostP   r      z	127.0.0.1)_cacher   getaddrinfoSOL_TCP)	addr_infoconfigs     ?/usr/lib/python3/dist-packages/_pydev_bundle/pydev_localhost.pyget_localhostr   	   sv     ~
	!#//RAv~~V "	"1!9+(F!M	" !FM6M	! F Ms   7A  	A 
A A%c                    g }g }t        |       D ]  }t        r)ddlm}  |d      }t	               |j                         f}nt        j                  t        j                  t        j                        }|j                  t        j                  t        j                  d       |j                  t	               df       |j                         }|j                  |       |j                  |        |r|D ]  }|j                           |S )Nr   )ServerSocket   )range	IS_JYTHONjava.netr   r   getLocalPortr   AF_INETSOCK_STREAM
setsockopt
SOL_SOCKETSO_REUSEADDRbindgetsocknameappendclose)		n_socketsr    socket_namessockets_r   socksocket_namess	            r   get_socket_namesr(   %   s    LG9 ) .?D'/4+<+<+>>K==1C1CDDOOF--v/B/BAFII}*+**,KtK()   	AGGI	    c                      t        d|       d   S )Nr   r   )r(   )r    s    r   get_socket_namer+   >   s    Au%a((r)   __main__)F)"_pydev_bundle._pydev_saved_modulesr   sysplatformfindr   r
   r   r(   r+   __name__print r)   r   <module>r4      sR    5 
LLf%+		82) z	/
 r)   