D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
python35
/
lib
/
python3.5
/
asyncio
/
__pycache__
/
Filename :
windows_utils.cpython-35.pyc
back
Copy
o��Y� � @ sJ d Z d d l Z e j d k r- e d � � d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d d d d g Z d Z e j Z e j Z e j � Z e e d � r� e j Z n e j e j d d d � Z d d d d d e d d � Z Gd d � d � Z Gd d � d e j � Z d S)z* Various Windows specific bits and pieces � N�win32z win32 only� socketpair�pipe�Popen�PIPE� PipeHandlei c C sk | t j k r d } n$ | t j k r0 d } n t d � � | t j k rW t d � � | d k ro t d � � t j | | | � } z� | j | d f � | j d � | j � d d � \ } } t j | | | � } yb | j d � y | j | | f � Wn t t f k rYn X| j d � | j � \ } } Wn | j � � Yn XWd | j � X| | f S)z�A socket pair usable as a self-pipe, for Windows. Origin: https://gist.github.com/4325783, by Geert Jansen. Public domain. z 127.0.0.1z::1z?Only AF_INET and AF_INET6 socket address families are supportedz)Only SOCK_STREAM socket type is supportedr zOnly protocol zero is supported� N� FT)�socket�AF_INET�AF_INET6� ValueError�SOCK_STREAM�bind�listen�getsockname�setblocking�connect�BlockingIOError�InterruptedError�accept�close) �family�type�proto�hostZlsock�addr�portZcsockZssock�_� r �,/opt/python35/lib/python3.5/windows_utils.pyr % s8 �duplexF� overlappedT�bufsizec C s� t j d d t j � t t � f � } | rW t j } t j t j B} | | } } n t j } t j } d | } } | t j O} | d r� | t j O} | d r� t j } n d } d } } y� t j | | t j d | | t j t j � } t j | | d t j t j | t j � } t j | d d �} | j d � | | f SWn= | d k rft j | � | d k rt j | � � Yn Xd S)zELike os.pipe() but with overlapped support and using handles not fds.�prefixz\\.\pipe\python-pipe-%d-%d-r r Nr"