diff --git a/ZE-Standard-Libraries.xcodeproj/xcuserdata/huyibing.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ZE-Standard-Libraries.xcodeproj/xcuserdata/huyibing.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index abe8217..ee2d7ff 100644 --- a/ZE-Standard-Libraries.xcodeproj/xcuserdata/huyibing.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/ZE-Standard-Libraries.xcodeproj/xcuserdata/huyibing.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -633,7 +633,7 @@ + endingLineNumber = "100" + landmarkName = "main" + landmarkType = "9"> + endingLineNumber = "99" + landmarkName = "main" + landmarkType = "9"> p_sid = getS_id(MESSAGE, 1); + p_msg->time = time(NULL); + return p_msg; +} + +/*int sendMessageIPv4(MSG *p_msg, char *ip, unsigned int port){ + int client_sockfd; + struct sockaddr_in remote_addr; + char buf[BUFSIZ]; + memcpy(buf, "ZEMSG", 5); + memset(&remote_addr,0,sizeof(remote_addr)); + remote_addr.sin_family=AF_INET; + remote_addr.sin_addr.s_addr=inet_addr(ip); + remote_addr.sin_port=htons(port); + client_sockfd=socket(PF_INET,SOCK_STREAM,0); + connect(client_sockfd,(struct sockaddr *)&remote_addr,sizeof(struct sockaddr)); + send(client_sockfd,buf,strlen(buf),0); + unsigned long bkmsg_len = 0; + bkmsg_len = recv(client_sockfd, buf, BUFSIZ, 0); + buf[bkmsg_len] = '\0'; + if(!strcmp(buf, "TITLE_REV_READY")){ + memcpy(buf, p_msg->titile, strlen(p_msg->titile)); + bkmsg_len = recv(client_sockfd, buf, BUFSIZ, 0); + buf[bkmsg_len] = '\0'; + if(!strcmp(buf, "CONTENT_LEN_REV_READY")){ + memcpy(buf, (char *)p_msg->size, sizeof(unsigned int)); + send(client_sockfd,buf,sizeof(unsigned int),0); + bkmsg_len = recv(client_sockfd, buf, BUFSIZ, 0); + buf[bkmsg_len] = '\0'; + if(!strcmp(buf, "CONTENT_REV_READY")){ + memcpy(buf, p_msg->content, p_msg->size); + send(client_sockfd,buf,p_msg->size,0); + close(client_sockfd); + return 0; + } + } + } + close(client_sockfd); + return -1; +}*/ diff --git a/communicate/communicate.h b/communicate/communicate.h index f73ea90..cff8f99 100644 --- a/communicate/communicate.h +++ b/communicate/communicate.h @@ -6,6 +6,7 @@ typedef struct message{ SID *p_sid; + time_t time; char titile[16]; unsigned long size; char content[0]; @@ -37,6 +38,9 @@ List *_doStandardDBlockWrite(unsigned int type, void *value, List *er_list); STD_DATA *listToSTD(List *); List *standardDataToList(STD_DATA *); List *_doStandardDataToList(unsigned int type, void *value, List *er_list); + +MSG *createMessage(char *title, void *data, unsigned long data_size); +int sendMessageIPv4(MSG *p_msg, char *ip, unsigned int port); //STD_DATA *stackToSTD(Stack *); //STD_DATA *treeToSTD(Tree *); diff --git a/type/type.h b/type/type.h index 2cc99a5..a1dbaa1 100644 --- a/type/type.h +++ b/type/type.h @@ -8,6 +8,13 @@ #include #include +/* +#include +#include +#include +#include +*/ + #define VOID 0 #define INT 1 #define DOUBLE 2 @@ -23,6 +30,7 @@ #define UINT 12 #define STANDARD_DATA 13 #define DATA_FILE 14 +#define MESSAGE 15 #define DEEPC 1 #define DEEPB 2