pymasep.communication.socket_handler ==================================== .. py:module:: pymasep.communication.socket_handler Classes ------- .. autoapisummary:: pymasep.communication.socket_handler.SocketHandler Module Contents --------------- .. py:class:: SocketHandler(conn, addr, logger) Bases: :py:obj:`threading.Thread` Thread used to handle received messages from conn, addr :param conn: connected socket :param addr: remote address :param logger: logger used to log send and receive message .. py:attribute:: lock lock to send/receive messages one at a time .. py:attribute:: logger logger of communication .. py:attribute:: socket socket to communicate .. py:attribute:: addr remote address .. py:attribute:: send_queue message queue for handling multithreading .. py:method:: __del__() delete the instance. close all sockets .. py:method:: send_frame(frame) send frame through socket :param frame: frame to send .. py:method:: receive_frame() wait for receiving frame from socket :return: received frame .. py:method:: send_frame_async(frame) Send a from asynchronously. Use the internal queue and socket as described here: https://stackoverflow.com/questions/51104534/python-socket-receive-send-multi-threading :param frame: Frame to send .. py:method:: on_receive(frame) Callback when a message is received (except for BYE frame). :param frame: Frame received .. py:method:: run() Main thread run that receives and send frames