ginsfsm.examples.stress_connections

GObj OnServer and OnClient

Utility for check a server/client gaplic’s running as thread or subprocesses and stress the connections.

It uses ginsfsm.c_srv_sock.GServerSock and ginsfsm.c_sock.GSock.

Run two gaplics. One is the server, the other the client.

Stress with many connections.

Configuration:
  • The server can run as thread o subprocess.
  • Limit of client connections to be reached.
class ginsfsm.examples.essential_gobjs.stress_connections.OnServer[source]

Server GObj.

Configurable Parameters:
Name Type Default value Description
connections int 0 Limit of connections to be reached.
verbose int 0 Increase output verbosity. Values [0,1,2]
Diagram:

Input-Events:

  • 'EV_TIMEOUT': Timer over.
    Start the machine.
  • 'EV_CONNECTED': New client.
  • 'EV_DISCONNECTED': Client disconnected.

Output-Events:

  • 'EV_START_TIMER': Start timer.
start_up()[source]

Initialization zone.

Well, the __init__ method is used to build the FSM so I need another function to initialize the new gobj. Please, override me, and write here all the code you need to start up the machine: create your owns childs, etc. This function is called by create_gobj() after creating the gobj instance.

class ginsfsm.examples.essential_gobjs.stress_connections.OnClient[source]

Client GObj.

Configurable Parameters:
Name Type Default value Description
connections int 0 Limit of connections to be reached.
verbose int 0 Increase output verbosity. Values [0,1,2]
Diagram:

Input-Events:

  • 'EV_TIMEOUT': Timer over.
    Start the machine.
  • 'EV_CONNECTED': Client connected.
  • 'EV_DISCONNECTED': Client disconnected.

Output-Events:

  • 'EV_START_TIMER': Start timer.
start_up()[source]

Initialization zone.

Well, the __init__ method is used to build the FSM so I need another function to initialize the new gobj. Please, override me, and write here all the code you need to start up the machine: create your owns childs, etc. This function is called by create_gobj() after creating the gobj instance.