Client.py – Client

Client module that sends reuqests and notifications to servers.

Classes

Client

class Client.Client(config, q, writer, serverQueues, stopQueue, counter, attackers, verbose=False)[source]

Initialization of the client class.

Parameters:
  • config – Own client configuration.
  • q – Own queue for receiving messages from servers.
  • writer – Queue for writing out a packet.
  • serverQueues – Queues of all available servers.
  • stopQueues – A DONE is sent to this queue if on q a DONE is received.
  • counter – Number of times all configured sending methods are used.
  • attackers – Attacker Queue as the attacker is implemented as MitM.
  • verbose – If set to True, more output is printed, default=False
setName(name)[source]

Setter for client name.

Functions

client

Client.client(c)[source]

worker function, that initializes the client and sends the configured number of packets, for each sent REQUEST state generated

getCurrentSessionID

Client.getCurrentSessionID(key, sharedDict, sessionIDInit)[source]

returns the session ID for a specific server, method, service pair, initializes the session id if not available in the state, yet

deleteUsedSessionID

Client.deleteUsedSessionID(sharedDict, server, service, method, session, c)[source]

Deletes the state and the session id, in case a response was received.

checkForResponse

Client.checkForResponse(server, service, method, session, state, message, ts, c)[source]

checks whether or not the incomming message is of type RESPONSE, in case an ERROR was received the message is resend

waitForIncomming

Client.waitForIncomming(c, sharedDict, state, lock)[source]

own thread waiting for incomming messages (responses or errors) while the main thread is sending more packets