Lines Matching full:request
15 For request-based servers (including socket-based):
17 - client address verification before further looking at the request
19 at the request before anything else, e.g. logging)
21 - synchronous (one request is handled at a time)
22 - forking (each request is handled by a new process)
23 - threading (each request is handled by a new thread)
65 with your request handler class.
67 The request handler class must be different for datagram or stream
68 services. This can be hidden by using the request handler
83 class will essentially render the service "deaf" while one request is
88 In some cases, it may be appropriate to process part of a request
90 the request data. This can be implemented by using a synchronous
91 server and doing an explicit fork in the request handler class
98 decide which request to work on next (or whether to handle a new
99 incoming request). This is particularly important for stream services
113 - split generic "request" functionality out into BaseServer class.
171 - get_request() -> request, client_address
173 - verify_request(request, client_address)
175 - process_request(request, client_address)
176 - shutdown_request(request)
177 - close_request(request)
182 - finish_request(request, client_address)
217 """Handle one request at a time until shutdown.
229 # shutdown request and wastes cpu at all other times.
249 # finishing a request is fairly arbitrary. Remember:
255 # or create a new thread to finish the request
256 # - finish_request() instantiates the request handler class;
257 # this constructor will handle the request all by itself
260 """Handle one request, possibly blocking.
278 """Handle one request, without blocking.
285 request, client_address = self.get_request()
288 if self.verify_request(request, client_address):
290 self.process_request(request, client_address)
292 self.handle_error(request, client_address)
293 self.shutdown_request(request)
295 self.shutdown_request(request)
298 """Called if no new request arrives within self.timeout.
304 def verify_request(self, request, client_address): argument
305 """Verify the request. May be overridden.
307 Return True if we should proceed with this request.
312 def process_request(self, request, client_address): argument
318 self.finish_request(request, client_address)
319 self.shutdown_request(request)
329 def finish_request(self, request, client_address): argument
330 """Finish one request by instantiating RequestHandlerClass."""
331 self.RequestHandlerClass(request, client_address, self)
333 def shutdown_request(self, request): argument
334 """Called to shutdown and close an individual request."""
335 self.close_request(request)
337 def close_request(self, request): argument
338 """Called to clean up an individual request."""
341 def handle_error(self, request, client_address): argument
348 print 'Exception happened during processing of request from',
373 - get_request() -> request, client_address
375 - verify_request(request, client_address)
376 - process_request(request, client_address)
377 - shutdown_request(request)
378 - close_request(request)
383 - finish_request(request, client_address)
459 """Get the request and client address from the socket.
466 def shutdown_request(self, request): argument
467 """Called to shutdown and close an individual request."""
471 request.shutdown(socket.SHUT_WR)
474 self.close_request(request)
476 def close_request(self, request): argument
477 """Called to clean up an individual request."""
478 request.close()
499 def shutdown_request(self, request): argument
501 self.close_request(request)
503 def close_request(self, request): argument
509 """Mix-in class to handle each request in a new process."""
556 def process_request(self, request, client_address): argument
557 """Fork a new subprocess to process the request."""
565 self.close_request(request) #close handle in parent process
571 self.finish_request(request, client_address)
572 self.shutdown_request(request)
576 self.handle_error(request, client_address)
577 self.shutdown_request(request)
583 """Mix-in class to handle each request in a new thread."""
589 def process_request_thread(self, request, client_address): argument
596 self.finish_request(request, client_address)
597 self.shutdown_request(request)
599 self.handle_error(request, client_address)
600 self.shutdown_request(request)
602 def process_request(self, request, client_address): argument
603 """Start a new thread to process the request."""
605 args = (request, client_address))
630 """Base class for request handler classes.
632 This class is instantiated for each request to be handled. The
633 constructor sets the instance variables request, client_address
638 The handle() method can find the request as self.request, the
641 separate instance is created for each request, the handle() method
646 def __init__(self, request, client_address, server): argument
647 self.request = request
669 # - rfile: a file object from which receives the request is read
688 # A timeout to apply to the request socket, if not None.
696 self.connection = self.request
726 self.packet, self.socket = self.request