# network **Repository Path**: iLKing/network ## Basic Information - **Project Name**: network - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-29 - **Last Updated**: 2021-11-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #### Full Name : Jason Huang #### Student ID: 3831191225 #### Done I finished phase 1-3 and also completed the optional part. Two paramaters can be inputted in client B. #### code files: ###### graph.h: Defines graph data structures for communication interactions. ###### clientA.c sends the user name and receives the result output from the server ###### clientB.c sends the user name and receives the result output from the server ###### serverC.c receives the user names of two clients, sends and receives data to three servers respectively, and sends the final result back to the client ###### serverT.c accepts two usernames of serverc and returns relevant graph data ###### serverS.c accepts the user name list and returns the score list of the user name ###### serverP.c accepts the graph data and score list related to the user name, and returns the compatibility user table and compatibility score #### The format of all the messages exchanged. The graph. H file defines a series of structural messages for communication between various services ###### serverC --> serverT MatchGraph ``` typedef struct _MatchGraph { char vexs[2][MAX_NAME_LEN]; } MatchGraph,*link_MatchGraph; ``` ###### serverT --> serverC VexWithScoreList score NOT FILL , so all is zero; ``` typedef struct _VexWithScore { char vexs[MAX_NAME_LEN]; int32_t score; } VexWithScore,*link_VexWithScore; typedef struct _VexWithScoreList { int32_t num_vert; VexWithScore vws[0]; } VexWithScoreList,*link_VexWithScoreList; ``` ###### serverC --> serverS VexWithScoreList score NOT FILL , so all is zero; ``` typedef struct _VexWithScore { char vexs[MAX_NAME_LEN]; int32_t score; } VexWithScore,*link_VexWithScore; typedef struct _VexWithScoreList { int32_t num_vert; VexWithScore vws[0]; } VexWithScoreList,*link_VexWithScoreList; ``` ###### serverS --> serverC VexWithScoreList score is filled; ``` typedef struct _VexWithScore { char vexs[MAX_NAME_LEN]; int32_t score; } VexWithScore,*link_VexWithScore; typedef struct _VexWithScoreList { int32_t num_vert; VexWithScore vws[0]; } VexWithScoreList,*link_VexWithScoreList; ``` ###### serverC --> serverP VexWithScoreList score is filled; ``` typedef struct _VexWithScoreList { int32_t num_vert; VexWithScore vws[0]; } VexWithScoreList,*link_VexWithScoreList; ``` ###### serverP --> serverC ``` typedef struct _Compatibility { char vexs[MAX][MAX_NAME_LEN]; int32_t num_vert; float score; } Compatibility,*link_Compatibility; ``` #### matters needing attention * We need to concerned about the starting sequence. We need to first run serverC, serverP, serverS, serverT. And then run serverA and then run serverB. * The program uses the memory direct copy of C language struct data type as the communication message transmission, so each service node must run in the same type of CPU host environment. For different types of CPUs, such as x86 and arm hosts, they may not be able to communicate with each other normally; #### Reused Code: beej exsample poolserver.c