Learning Python Network Programming
Client and Server Applications On modern hardware it's actually possible to handle ten-thousand concurrent connections using a m ...
Chapter 8 A low-level event-driven chat server So the event-driven architecture has a few great benefits, the catch is that for ...
Client and Server Applications if __name__ == '__main__': listen_sock = tincanchat.create_listen_socket(HOST, PORT) poll = selec ...
Chapter 8 tincanchat.parse_recvd_data(data) # If we have any messages, broadcast them to all # clients for msg in msgs: msg = '{ ...
Client and Server Applications Because we're only running in a single thread, we don't need any of the synchronization mechanism ...
Chapter 8 An eventlet-based chat server The eventlet library provides a high-level API for event-driven programming, but it does ...
Client and Server Applications def handle_client_send(sock, q, addr): """ Monitor queue for new messages, send them to client as ...
Chapter 8 eventlet.spawn_n(handle_client_send, client_sock, q, addr) print('Connection from {}'.format(addr)) We can test this w ...
Client and Server Applications def connection_made(self, transport): """ Called on instantiation, when new client connects """ s ...
Chapter 8 Let's step through the code, as it's quite different from our previous servers. We begin by defining our server behavi ...
Client and Server Applications More on frameworks I've broken from our usual procedural form and used an object-oriented approac ...
Chapter 8 For all our servers, we would also want to add a logging mechanism. I strongly recommend the standard library logging ...
...
Applications for the Web In Chapter 2, HTTP and Working with the Web, we explored the HTTP protocol—the primary protocol used by ...
Applications for the Web What's in a web server? To understand how we can employ Python in responding to HTTP requests, we need ...
Chapter 9 First the web server program needs to accept the TCP connection attempt by the client. It then receives the HTTP reque ...
Applications for the Web This external code is what we commonly refer to when we talk about web applications. So the response pr ...
Chapter 9 The much stronger requirement is to build a web service application to generate some dynamic content, and to get it up ...
Applications for the Web Some frameworks provide the minimum to quickly build a simple web application. These are often called m ...
Chapter 9 docstrings = {name.lower(): obj.__doc__ for name, obj in objs if name[0].islower() and hasattr(obj, '__name__')} @app. ...
«
7
8
9
10
11
12
13
14
15
16
»
Free download pdf