httpx.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:socket-http 作者: thisforeda 项目源码 文件源码
def send(self,send_data):
        if self.__is_addr_reset or \
                         self._is_close_for_invoker or \
                                               self.__is_connection_closed():
            self.__connection = socket(AF_INET,SOCK_STREAM)

            if self.__is_ssl:
                self.__connection = ssl.wrap_socket(self.__connection)

            try :
                self.__connection.connect(self.__addr)

                self.__connection.settimeout(self.__timeout)

                self._is_close_for_invoker = False
                self.__is_addr_reset = False

            except Exception as exception:
                self.__recorder.write(
                    'Cannot connect %s' % str(self.__addr),
                    Exception = str(exception))
                return None

        self.__connection.send(send_data)
        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号