HandlerRequests module¶
-
class
handler.HandlerRequests.
Handler
(server)¶ Bases:
threading.Thread
Class responsible for handling incoming requests and sending responses
-
checkTypeRequest
(request: message.Request.Request, connectionSocket: socket.socket) → None¶ Responsible for checking the request type and calling the appropriate method
- Parameters
request – A Request object
connectionSocket – A tcp socket
- Returns
None
-
run
() → None¶ Responsible for running the server
- Returns
None
-
-
handler.HandlerRequests.
recv
(sock: socket.socket, chunkSize: int = 8192) → any¶ Responsible for receiving all the request message chunks from the socket
- Parameters
sock – the tcp socket responsible for receiving and sending messages
chunkSize – the size of each incoming request message fragment
- Returns
A byte object containing the whole request message or None