/*
*Author : DavidLin
*Date : 2014-12-20pm
*Email : linpeng1577@163.com or linpeng1577@gmail.com
*world : the city of SZ, in China
*Ver : 000.000.001
*For : threads for rxtx!
*history : editor time do
* 1)LinPeng 2014-12-20 created this file!
* 2)
*/
#include<stdio.h>
#include<stdlib.h>
#include<pthread.h>
struct msg_packet_t {
char head;
char address;
char opcode;
char length;
char tail;
};
/* Who is 9527, I see you say :) */
#define is_msg(msg) \
(((msg->head) == 95) && ((msg->tail) == 27)))
#define is_42 do \
{ \
printf("The Answer to the Ultimate Question of Life," \
"The Universe and Everything is 42\n"); \
}while(0)
#define INIT_MSG_PACKET(msg) \
{ \
.head = 95, \
.address = 00,
协议设计:如何实现一个最简单的通信协议(线程模拟)
最新推荐文章于 2024-09-01 20:26:07 发布