
    R&i                     $    d Z ddlZddlmZ d ZdS )zGeneric utilities.    N)closingc                  V   t          t          j        t          j        t          j                            5 } |                     d           |                     t          j        t          j        d           |                                 d         cddd           S # 1 swxY w Y   dS )zhFind and return a free port number.

    Shout-out to https://stackoverflow.com/a/45690594/1931274!
    ) r      N)	r   socketAF_INETSOCK_STREAMbind
setsockopt
SOL_SOCKETSO_REUSEADDRgetsockname)ss    c/home/geonatureadmin/si_en_reseau/tutos/venv/lib/python3.11/site-packages/sphinx_autobuild/utils.pyfind_free_portr      s    
 
v~v/ABB	C	C "q	w	V&(;Q???}}q!" " " " " " " " " " " " " " " " " "s   ABB"%B")__doc__r   
contextlibr   r        r   <module>r      s?            " " " " "r   