ó
VQc           @   sW   d  d l  Z  d  d l Td  d l Z d  d l Z d Z d Z d   Z d   Z e   d S(   i˙˙˙˙N(   t   *i  i   c          C   sç   t  t j  d k r1 t t t j d   }  n t }  t t t  } | j	 d |  f  | j
 d  xz | j   \ } \ } } d G| G| GHd } x& | j t  } | s° Pn  | | } q t |  } | j |  | j   qi d  S(   Ni   t    s   connected by(   t   lent   syst   argvt   intt   evalt   PORTt   sockett   AF_INETt   SOCK_STREAMt   bindt   listent   acceptt   recvt   BUFSIZEt   executet   sendt   close(   t   portt   st   connt
   remotehostt
   remoteportt   requestt   datat   reply(    (    s-   /usr/lib64/python2.7/Demo/sockets/rpythond.pyt   main   s$    c         B   sv   e  j } e  j } e j   e  _ e  _ } z* y |  i  i  UWn He j d  n XWd  | e  _ | e  _ X| j   S(   Nid   (   R   t   stdoutt   stderrt   StringIOt	   tracebackt	   print_exct   getvalue(   R   R   R   t   fakefile(    (    s-   /usr/lib64/python2.7/Demo/sockets/rpythond.pyR   %   s    			
(   R   R   R   R   R   R   R   R   (    (    (    s-   /usr/lib64/python2.7/Demo/sockets/rpythond.pyt   <module>   s   
		