nopasaran.primitives.action_primitives.server_echo_primitives.ServerEchoPrimitives

class nopasaran.primitives.action_primitives.server_echo_primitives.ServerEchoPrimitives

Bases: object

Class containing Echo server action primitives for the state machine.

__init__()

Methods

__init__()

close_tcp_echo_server(inputs, outputs, ...)

Close the TCP Echo server.

close_udp_echo_server(inputs, outputs, ...)

Close the UDP Echo server.

create_echo_server(inputs, outputs, ...)

Create a TCP Echo server instance.

start_tcp_echo_server(inputs, outputs, ...)

Start the TCP Echo server and wait for a connection.

start_udp_echo_server(inputs, outputs, ...)

Start the UDP Echo server and wait for a datagram.

static close_tcp_echo_server(inputs, outputs, state_machine)

Close the TCP Echo server.

Number of input arguments: 1 Number of output arguments: 1 Optional input arguments: No Optional output arguments: No

Args:
inputs (List[str]): The list of input variable names. It contains one mandatory input argument:
  • The name of the variable containing the EchoSocketServer instance.

outputs (List[str]): The list of output variable names. It contains one mandatory output argument:
  • The name of the variable to store the close event result.

state_machine: The state machine object.

Returns:

None

static close_udp_echo_server(inputs, outputs, state_machine)

Close the UDP Echo server.

Number of input arguments: 1 Number of output arguments: 1 Optional input arguments: No Optional output arguments: No

Args:
inputs (List[str]): The list of input variable names. It contains one mandatory input argument:
  • The name of the variable containing the EchoSocketServer instance.

outputs (List[str]): The list of output variable names. It contains one mandatory output argument:
  • The name of the variable to store the close event result.

state_machine: The state machine object.

Returns:

None

static create_echo_server(inputs, outputs, state_machine)

Create a TCP Echo server instance.

Number of input arguments: 0 Number of output arguments: 1 Optional input arguments: No Optional output arguments: No

Args:

inputs (List[str]): No input arguments. outputs (List[str]): The list of output variable names. It contains one mandatory output argument:

  • The name of the variable to store the EchoSocketServer instance.

state_machine: The state machine object.

Returns:

None

static start_tcp_echo_server(inputs, outputs, state_machine)

Start the TCP Echo server and wait for a connection.

Number of input arguments: 4 Number of output arguments: 2 Optional input arguments: No Optional output arguments: No

Args:
inputs (List[str]): The list of input variable names. It contains three mandatory input arguments:
  • The name of the variable containing the EchoSocketServer instance.

  • The name of the variable containing the host address.

  • The name of the variable containing the port number.

  • The name of the variable containing the timeout in seconds.

outputs (List[str]): The list of output variable names. It contains two mandatory output arguments:
  • The name of the variable to store the triggered event (REQUEST_RECEIVED or TIMEOUT).

  • The name of the variable to store the response data (string or None).

state_machine: The state machine object.

Returns:

None

static start_udp_echo_server(inputs, outputs, state_machine)

Start the UDP Echo server and wait for a datagram.

Number of input arguments: 4 Number of output arguments: 2 Optional input arguments: No Optional output arguments: No

Args:
inputs (List[str]): The list of input variable names. It contains three mandatory input arguments:
  • The name of the variable containing the EchoSocketServer instance.

  • The name of the variable containing the host address.

  • The name of the variable containing the port number.

  • The name of the variable containing the timeout in seconds.

outputs (List[str]): The list of output variable names. It contains two mandatory output arguments:
  • The name of the variable to store the triggered event (REQUEST_RECEIVED or TIMEOUT).

  • The name of the variable to store the response data (string or None).

state_machine: The state machine object.

Returns:

None