• Home
  • Raw
  • Download

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
112 - split generic "request" functionality out into BaseServer class.
169 - get_request() -> request, client_address
171 - verify_request(request, client_address)
173 - process_request(request, client_address)
174 - shutdown_request(request)
175 - close_request(request)
181 - finish_request(request, client_address)
216 """Handle one request at a time until shutdown.
226 # responsiveness to a shutdown request and wastes cpu at all other
263 # request is fairly arbitrary. Remember:
269 # new thread to finish the request
270 # - finish_request() instantiates the request handler class; this
271 # constructor will handle the request all by itself
274 """Handle one request, possibly blocking.
288 # Wait until a request arrives or the timeout expires - the loop is
304 """Handle one request, without blocking.
311 request, client_address = self.get_request()
314 if self.verify_request(request, client_address):
316 self.process_request(request, client_address)
318 self.handle_error(request, client_address)
319 self.shutdown_request(request)
321 self.shutdown_request(request)
324 self.shutdown_request(request)
327 """Called if no new request arrives within self.timeout.
333 def verify_request(self, request, client_address): argument
334 """Verify the request. May be overridden.
336 Return True if we should proceed with this request.
341 def process_request(self, request, client_address): argument
347 self.finish_request(request, client_address)
348 self.shutdown_request(request)
358 def finish_request(self, request, client_address): argument
359 """Finish one request by instantiating RequestHandlerClass."""
360 self.RequestHandlerClass(request, client_address, self)
362 def shutdown_request(self, request): argument
363 """Called to shutdown and close an individual request."""
364 self.close_request(request)
366 def close_request(self, request): argument
367 """Called to clean up an individual request."""
370 def handle_error(self, request, client_address): argument
377 print('Exception happened during processing of request from',
408 - get_request() -> request, client_address
410 - verify_request(request, client_address)
411 - process_request(request, client_address)
412 - shutdown_request(request)
413 - close_request(request)
418 - finish_request(request, client_address)
494 """Get the request and client address from the socket.
501 def shutdown_request(self, request): argument
502 """Called to shutdown and close an individual request."""
506 request.shutdown(socket.SHUT_WR)
509 self.close_request(request)
511 def close_request(self, request): argument
512 """Called to clean up an individual request."""
513 request.close()
534 def shutdown_request(self, request): argument
536 self.close_request(request)
538 def close_request(self, request): argument
544 """Mix-in class to handle each request in a new process."""
601 def process_request(self, request, client_address): argument
602 """Fork a new subprocess to process the request."""
609 self.close_request(request)
616 self.finish_request(request, client_address)
619 self.handle_error(request, client_address)
622 self.shutdown_request(request)
632 """Mix-in class to handle each request in a new thread."""
643 def process_request_thread(self, request, client_address): argument
650 self.finish_request(request, client_address)
652 self.handle_error(request, client_address)
654 self.shutdown_request(request)
656 def process_request(self, request, client_address): argument
657 """Start a new thread to process the request."""
659 args = (request, client_address))
698 """Base class for request handler classes.
700 This class is instantiated for each request to be handled. The
701 constructor sets the instance variables request, client_address
706 The handle() method can find the request as self.request, the
709 separate instance is created for each request, the handle() method
714 def __init__(self, request, client_address, server): argument
715 self.request = request
737 # - rfile: a file object from which receives the request is read
756 # A timeout to apply to the request socket, if not None.
764 self.connection = self.request
812 self.packet, self.socket = self.request