message.h

来自「一个很好的例子-基于Linux的消息传输系统」· C头文件 代码 · 共 42 行

H
42
字号
#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

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?