60 likes | 198 Views
Implementation CAN Communication 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
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