Edit File: socket_options.cpython-36.pyc
3 �P\� � @ sz d Z ddlZddlZddlZddlZddlmZ ddlmZ ddlmZ ddl m Z G dd � d ej�Z G d d� de �ZdS )z/The implementation of the SocketOptionsAdapter.� N)�adapters� )� connection)�poolmanager)� exceptionsc sd e Zd ZdZedk r0eejdejej dfg�Z ng Z eje jd� � fdd�Zd� fd d � Z� ZS )�SocketOptionsAdapterad An adapter for requests that allows users to specify socket options. Since version 2.4.0 of requests, it is possible to specify a custom list of socket options that need to be set before establishing the connection. Example usage:: >>> import socket >>> import requests >>> from requests_toolbelt.adapters import socket_options >>> s = requests.Session() >>> opts = [(socket.IPPROTO_TCP, socket.TCP_NODELAY, 0)] >>> adapter = socket_options.SocketOptionsAdapter(socket_options=opts) >>> s.mount('http://', adapter) You can also take advantage of the list of default options on this class to keep using the original options in addition to your custom options. In that case, ``opts`` might look like:: >>> opts = socket_options.SocketOptionsAdapter.default_options + opts NZdefault_socket_options� z�This version of Requests is only compatible with a version of urllib3 which is too old to support setting options on a socket. This adapter is functionally useless.c s&