1999, RFC 2616, HTTP/1.1, Internet Standard … 16 years … May 2015, RFC 7540, HTTP/2, Performance Improvement … 26 years in 2017, older than some people here :)
True: data = sock.recv(65535) if not data: break events = conn.receive_data(data) for event in events: if isinstance(event, h2.events.RequestReceived): send_response(conn, event) data_to_send = conn.data_to_send() if data_to_send: sock.sendall(data_to_send) sock = socket.socket() sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.bind(('0.0.0.0', 8080)) sock.listen(5) while True: handle(sock.accept()[0])
• 0-RTT connectivity overhead for secure connections • Avoids all connection streams stalling when single packet was lost • Congestion avoidance algorithms in application space, instead of kernel space
package and upload it to the local PyPI server $ cat setup.py from setuptools import setup, find_packages setup( name='helloworld-proto', version='0.1.0', description='HelloWorld service stub files', packages=find_packages(), ... ) $ python setup.py sdist $ twine upload -r pypi.uaprom dist/helloworld-proto-0.1.0.tar.gz
Google examples: https://github.com/googleapis/googleapis/tree/master/google Search well-known types before implementing yours Proto3 supports a canonical encoding in JSON
protocol • Initially supports streaming • Can handle any content, incl. large files upload/download Hiku • reads/writes query encoded with Protocol Buffers • serializes result into Protocol Buffers message