11. cc_tcp_ip

11.1. Communication Channel via socket

module

cc_socket

synopsis

connector for communication via socket

class pykiso.lib.connectors.cc_tcp_ip.CCTcpip(dest_ip, dest_port, max_msg_size=256, **kwargs)[source]

Connector channel used to communicate via socket

Initialize channel settings.

Parameters
  • dest_ip (str) – destination ip address

  • dest_port (int) – destination port

  • max_msg_size (int) – the maximum amount of data to be received at once

_cc_close()[source]

Close UDP socket.

Return type

None

_cc_open()[source]

Connect to socket with configured port and IP address.

Return type

None

_cc_receive(timeout=0.01)[source]

Read message from socket.

Parameters

timeout – time in second to wait for reading a message

Return type

Dict[str, Optional[bytes]]

Returns

Message if successful, otherwise none

_cc_send(msg)[source]

Send a message via socket.

Parameters

msg (bytes) – message to send

Return type

None