Your IP : 216.73.216.213
�
V� � @ si d Z d d l Td d l Z d d l Z d g Z e j Z e j e j f Z Gd d � d e j � Z
d S)z}
SocketIO imported from socket module in Python 3.
Copyright (c) 2001-2013 Python Software Foundation; All Rights Reserved.
� )�*N�SocketIOc s� e Z d Z d Z d d � Z d d � Z d d � Z d d � Z d
d � Z � f d d
� Z d d � Z
e d d � � Z e d d � � Z
d d � Z � S)r z�Raw I/O implementation for stream sockets.
This class supports the makefile() method on sockets. It provides
the raw I/O interface on top of a socket object.
c C s | d
k r t d | � � t j j | � | | _ d | k rK | d 7} | | _ d | k | _ d | k | _ d | _ d S)N�r�w�rw�rb�wb�rwbzinvalid mode: %r�bF)r r r r r r ) �
ValueError�io� RawIOBase�__init__�_sock�_mode�_reading�_writing�_timeout_occurred)�selfZsock�mode� r �B/opt/alt/python35/lib/python3.5/site-packages/pymysql/_socketio.pyr ! s
zSocketIO.__init__c C s� | j � | j � | j r) t d � � x� y | j j | � SWq, t k
r` d | _ � Yq, t k
r� } z4 | j d } | t k r� w, | t
k r� d S� WYd d } ~ Xq, Xq, Wd S)a3 Read up to len(b) bytes into the writable buffer *b* and return
the number of bytes read. If the socket is non-blocking and no bytes
are available, None is returned.
If *b* is non-empty, a 0 return value indicates that the connection
was shutdown at the other end.
z!cannot read from timed out objectTr N)�_checkClosed�_checkReadabler �IOErrorr Z recv_intoZtimeout�error�args�EINTR�_blocking_errnos)r r
�e�nr r r �readinto- s"