一个很好的例子-基于Linux的消息传输系统

源代码在线查看: message.h

软件大小: 2161 K
上传用户: xulei147
关键词: Linux 传输系统
下载地址: 免注册下载 普通下载 VIP

相关代码

				#include"transform.h" 
				/**
				* Put a Message object input to the Send Buffer of the CI. If the
				* buffer is full, then return false, else return true. Once the message
				* is in the buffer, it will be sent by the CI object automatically.
				* @param ci The actor of the method
				* @param msg The Message object waiting to be sent.
				in*/
				//#ifndef MES_H
				//#define MES_H
				void putMessage(CI* ci, Message* msg,char *ip,int port);
				
				void putMessageRec(CI* ci, Message* msg,char *ip,int port);
				/**
				* Get a Message object from the Receive Buffer of the CI. If the
				* buffer is empty, then return null, else return the Message object.
				* @param ci The actor of the method
				* @return The received Message object
				*/
				Message* getMessage(CI* ci);
				
				/**
				* Create a Message object.
				* @param type The type of this message
				* @param serial Serial number of this message
				* @param src The name of the source unit of the message 
				* @param des The name of the destination unit of the message 
				* @param priority The priority of this message
				* @param length The byte-size of content
				* @param content The content of the message
				*/
				Message* createMessage(int type, int serial, char* src, char *srcIp,int srcPort,char* des, int priority, int length, void* content);
				
				/**
				* Destroy a Message object.
				* @param msg The Message object being destroyed
				* 
				*/
				void destroyMessage(Message* msg);
				
				//1#endif
							

相关资源