60 likes | 212 Vues
This document outlines the implementation details of a CAN Communication Engine by Hansang Kwon and Bongsu, elaborated on October 14, 2002. The engine operates as a TCP Server, consistently listening on port 4444 for incoming connections. It handles message reception and queuing through a structured message queue system utilizing a hash table for synchronization. Key functionalities include subscribing and unsubscribing from message notifications, retrieving messages from the queue, and sending messages to specified IP addresses. This implementation is crucial for ensuring reliable communication in CAN systems.
E N D
Implementation CANCommunication Engine By Rhee, Hansang Kwon, Bongsu 10/14/2002
Communication Engine : Over View TCPServer TCP Listener Msg RCV MsgQueue Register CommEngine Send Msg API
Communication Engine • TCP Sever : Demon always running • TCP port (4444) Listening • Process • A node try connect -> accept->receive msg ->Queuing Message • Message Queue handling • Socket Interface • Receive message • Send message
Class TCP Server • Thread Have to wait until accept a connection… • Message Queue Using HashTable (id = key, msg = value) Synchronization ( Mutex or Monitor)
Class CommEgine public bool SubscribeMsg(byte[] id) - insert id in the register public bool UnsubscribeMsg(byte[] id) - delete id in the register public byte[] GetMsg(byte[] id) - register check -> get Msg from Msg Queue -> return Msg public bool SendMsg(byte[] id, byte[] msg, string ip) - create a socket -> connect -> send Msg