Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10)

Side by Side Diff: Doc/library/socketserver.rst

Issue 18758: Fix internal references in the documentation
Patch Set: Created 6 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Doc/library/socket.rst ('k') | Doc/library/stat.rst » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`socketserver` --- A framework for network servers 1 :mod:`socketserver` --- A framework for network servers
2 ======================================================= 2 =======================================================
3 3
4 .. module:: socketserver 4 .. module:: socketserver
5 :synopsis: A framework for network servers. 5 :synopsis: A framework for network servers.
6 6
7 **Source code:** :source:`Lib/socketserver.py` 7 **Source code:** :source:`Lib/socketserver.py`
8 8
9 -------------- 9 --------------
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 essentially render the service "deaf" while one request is being handled -- 104 essentially render the service "deaf" while one request is being handled --
105 which may be for a very long time if a client is slow to receive all the data it 105 which may be for a very long time if a client is slow to receive all the data it
106 has requested. Here a threading or forking server is appropriate. 106 has requested. Here a threading or forking server is appropriate.
107 107
108 In some cases, it may be appropriate to process part of a request synchronously, 108 In some cases, it may be appropriate to process part of a request synchronously,
109 but to finish processing in a forked child depending on the request data. This 109 but to finish processing in a forked child depending on the request data. This
110 can be implemented by using a synchronous server and doing an explicit fork in 110 can be implemented by using a synchronous server and doing an explicit fork in
111 the request handler class :meth:`handle` method. 111 the request handler class :meth:`handle` method.
112 112
113 Another approach to handling multiple simultaneous requests in an environment 113 Another approach to handling multiple simultaneous requests in an environment
114 that supports neither threads nor :func:`fork` (or where these are too expensive 114 that supports neither threads nor :func:`~os.fork` (or where these are too expen sive
115 or inappropriate for the service) is to maintain an explicit table of partially 115 or inappropriate for the service) is to maintain an explicit table of partially
116 finished requests and to use :func:`select` to decide which request to work on 116 finished requests and to use :func:`~select.select` to decide which request to w ork on
117 next (or whether to handle a new incoming request). This is particularly 117 next (or whether to handle a new incoming request). This is particularly
118 important for stream services where each client can potentially be connected for 118 important for stream services where each client can potentially be connected for
119 a long time (if threads or subprocesses cannot be used). See :mod:`asyncore` 119 a long time (if threads or subprocesses cannot be used). See :mod:`asyncore`
120 for another way to manage this. 120 for another way to manage this.
121 121
122 .. XXX should data and methods be intermingled, or separate? 122 .. XXX should data and methods be intermingled, or separate?
123 how should the distinction between class and instance variables be drawn? 123 how should the distinction between class and instance variables be drawn?
124 124
125 125
126 Server Objects 126 Server Objects
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 553
554 $ python ThreadedTCPServer.py 554 $ python ThreadedTCPServer.py
555 Server loop running in thread: Thread-1 555 Server loop running in thread: Thread-1
556 Received: Thread-2: Hello World 1 556 Received: Thread-2: Hello World 1
557 Received: Thread-3: Hello World 2 557 Received: Thread-3: Hello World 2
558 Received: Thread-4: Hello World 3 558 Received: Thread-4: Hello World 3
559 559
560 560
561 The :class:`ForkingMixIn` class is used in the same way, except that the server 561 The :class:`ForkingMixIn` class is used in the same way, except that the server
562 will spawn a new process for each request. 562 will spawn a new process for each request.
OLDNEW
« no previous file with comments | « Doc/library/socket.rst ('k') | Doc/library/stat.rst » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+