@@ -116,23 +116,28 @@ server is the address family.
116
116
:class: `ForkingMixIn ` and the Forking classes mentioned below are
117
117
only available on POSIX platforms that support :func: `~os.fork `.
118
118
119
- :meth: `socketserver.ForkingMixIn.server_close ` waits until all child
120
- processes complete, except if
121
- :attr: `socketserver.ForkingMixIn.block_on_close ` attribute is false.
119
+ .. attribute :: block_on_close
122
120
123
- :meth: `socketserver.ThreadingMixIn.server_close ` waits until all non-daemon
124
- threads complete, except if
125
- :attr: `socketserver.ThreadingMixIn.block_on_close ` attribute is false. Use
126
- daemonic threads by setting
127
- :data: `ThreadingMixIn.daemon_threads ` to ``True `` to not wait until threads
128
- complete.
121
+ :meth: `ForkingMixIn.server_close <BaseServer.server_close> `
122
+ waits until all child processes complete, except if
123
+ :attr: `block_on_close ` attribute is ``False ``.
124
+
125
+ :meth: `ThreadingMixIn.server_close <BaseServer.server_close> `
126
+ waits until all non-daemon threads complete, except if
127
+ :attr: `block_on_close ` attribute is ``False ``.
128
+
129
+ .. attribute :: daemon_threads
130
+
131
+ For :class: `ThreadingMixIn ` use daemonic threads by setting
132
+ :data: `ThreadingMixIn.daemon_threads <daemon_threads> `
133
+ to ``True `` to not wait until threads complete.
129
134
130
135
.. versionchanged :: 3.7
131
136
132
- :meth: `socketserver. ForkingMixIn.server_close ` and
133
- :meth: `socketserver. ThreadingMixIn.server_close ` now waits until all
137
+ :meth: `ForkingMixIn.server_close <BaseServer.server_close> ` and
138
+ :meth: `ThreadingMixIn.server_close <BaseServer.server_close> ` now waits until all
134
139
child processes and non-daemonic threads complete.
135
- Add a new :attr: `socketserver. ForkingMixIn.block_on_close ` class
140
+ Add a new :attr: `ForkingMixIn.block_on_close <block_on_close> ` class
136
141
attribute to opt-in for the pre-3.7 behaviour.
137
142
138
143
@@ -412,13 +417,13 @@ Request Handler Objects
412
417
413
418
This function must do all the work required to service a request. The
414
419
default implementation does nothing. Several instance attributes are
415
- available to it; the request is available as :attr: `self. request `; the client
416
- address as :attr: `self. client_address `; and the server instance as
417
- :attr: `self. server `, in case it needs access to per-server information.
420
+ available to it; the request is available as :attr: `request `; the client
421
+ address as :attr: `client_address `; and the server instance as
422
+ :attr: `server `, in case it needs access to per-server information.
418
423
419
- The type of :attr: `self. request ` is different for datagram or stream
420
- services. For stream services, :attr: `self. request ` is a socket object; for
421
- datagram services, :attr: `self. request ` is a pair of string and socket.
424
+ The type of :attr: `request ` is different for datagram or stream
425
+ services. For stream services, :attr: `request ` is a socket object; for
426
+ datagram services, :attr: `request ` is a pair of string and socket.
422
427
423
428
424
429
.. method :: finish()
@@ -428,20 +433,42 @@ Request Handler Objects
428
433
raises an exception, this function will not be called.
429
434
430
435
436
+ .. attribute :: request
437
+
438
+ The *new * :class: `socket.socket ` object
439
+ to be used to communicate with the client.
440
+
441
+
442
+ .. attribute :: client_address
443
+
444
+ Client address returned by :meth: `BaseServer.get_request `.
445
+
446
+
447
+ .. attribute :: server
448
+
449
+ :class: `BaseServer ` object used for handling the request.
450
+
451
+
431
452
.. class :: StreamRequestHandler
432
453
DatagramRequestHandler
433
454
434
455
These :class: `BaseRequestHandler ` subclasses override the
435
456
:meth: `~BaseRequestHandler.setup ` and :meth: `~BaseRequestHandler.finish `
436
- methods, and provide :attr: `self.rfile ` and :attr: `self.wfile ` attributes.
437
- The :attr: `self.rfile ` and :attr: `self.wfile ` attributes can be
438
- read or written, respectively, to get the request data or return data
439
- to the client.
440
- The :attr: `!rfile ` attributes support the :class: `io.BufferedIOBase ` readable interface,
441
- and :attr: `!wfile ` attributes support the :class: `!io.BufferedIOBase ` writable interface.
457
+ methods, and provide :attr: `rfile ` and :attr: `wfile ` attributes.
458
+
459
+ .. attribute :: rfile
460
+
461
+ A file object from which receives the request is read.
462
+ Support the :class: `io.BufferedIOBase ` readable interface.
463
+
464
+ .. attribute :: wfile
465
+
466
+ A file object to which the reply is written.
467
+ Support the :class: `io.BufferedIOBase ` writable interface
468
+
442
469
443
470
.. versionchanged :: 3.6
444
- :attr: `StreamRequestHandler. wfile ` also supports the
471
+ :attr: `wfile ` also supports the
445
472
:class: `io.BufferedIOBase ` writable interface.
446
473
447
474
0 commit comments