⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 moi.h

📁 一个很好的例子-基于Linux的消息传输系统
💻 H
字号:
#include "ci.h"
#include "LinkedList.h"
#include "transform.h"
typedef struct MOI
{
      char appName[32];
      int appId;
      char src[32];
      CI * ci;
}MOI;	

typedef struct app_name_id_t
{
	char app_Name[32];
	int app_ID;	
}app_name_id_t;

typedef struct app_info_t
{
	char 	dest_dmt_name[32];
	int	dest_app_id;	
}app_info_t;

typedef struct msg_t
{
	int	length;
	char*	message;
}msg_t;

/**
* Register to MTS. If registration fails, then returns null, else returns * MOI object for communication.
* @param appName The name of Application
* @param appID The ID of Application
* @param group The group that Application asks DMT to join
* @return MOI objects
*/
int app_register(app_name_id_t app_name_id, char group[32]);


/**
* 
* @param appName The name of Application
* @param sendRange This param have WO ,SP and WO+SP status 
* @param type This param have direct,indirect and group status
* @param syn This param is to decide the send style,synchronization or asynchronism
* @param compulsory This param is to decide the WO and SP sending style. 
* @param priority This param is to decide the sending priority of the message
* @return MOI objects
*/
void transnate_setoption(int SetOption,int *sendRange,int *type,int *syn,int *compulsory,int *priority);


/**
* Send message to app. If sending fails, then returns null, else returns * MOI object for communication.
* @param dest_app The app name and DMT name of destination Application
* @param SendOption The sending style of Application
* @param msg The content that Application wants to send to another app.
* @return sending result
*/
int app_send(app_info_t dest_app, int SendOption,  msg_t msg);


/**
* Receive message from the ci receive queue.
* @param src_app The resource appId and DMT name.
* @param time The waiting time of getting Message from CI.
* @param msg The msg_t object that saving the receiving content and its length
* @return receiving result
*/
int receive(app_info_t* src_app, int time, msg_t *msg);

/*int putMessage(CI *ci,Message *msg,char *ip,int port);

Message * getMessage(CI *ci);

void destroyMessage(Message* msg);

Message* createMessage(int type, int serial, char* src, char *srcIp,int srcPort,char* des, int priority, int length, void* content);
*/

⌨️ 快捷键说明

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