12. cc_udp

12.1. Communication Channel Via Udp

module

cc_udp

synopsis

Udp communication channel

class pykiso.lib.connectors.cc_udp.CCUdp(dest_ip, dest_port, **kwargs)[source]

UDP implementation of the coordination channel.

Initialize attributes.

Parameters
  • dest_ip (str) – destination ip address

  • dest_port (int) – destination port

_cc_close()[source]

Close the udp socket.

Return type

None

_cc_open()[source]

Open the udp socket.

Return type

None

_cc_receive(timeout=1e-07, raw=False)[source]

Read message from socket.

Parameters
  • timeout (float) – timeout applied on receive event

  • raw (bool) – if raw is True return raw bytes, otherwise Message type like

Return type

Union[Message, bytes, None]

Returns

Message or raw bytes if successful, otherwise None

_cc_send(msg, raw=False)[source]

Send message using udp socket

Parameters
  • msg (bytes) – message to send, should be Message type or bytes.

  • raw (bool) – if raw is True simply send it as it is, otherwise apply serialization

Return type

None