Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Communications and Networking COMP 2330 Laboratory 5 Mr. Kaiyong Zhao Please sign your name with your attendance.

Similar presentations


Presentation on theme: "Data Communications and Networking COMP 2330 Laboratory 5 Mr. Kaiyong Zhao Please sign your name with your attendance."— Presentation transcript:

1 Data Communications and Networking COMP 2330 Laboratory 5 Mr. Kaiyong Zhao Please sign your name with your attendance

2 WSADATA wsadata; if (WSAStartup(MAKEWORD(2,2), &wsadata) != 0) errexit("WSAStartup failed\n"); 1. About WSADATA 2. C format string a C string consists of two parts “abcdafda\0” data end recvn(sockfd, buff, N); buf[N] = ‘\0’; printf(“The received data is %s”, buf) Initialize the WinSock DLL( Dynamic Link Library ) Launch the winsock function 3. What is recvn? int recvn(SOCKET sockfd, char * dist, int N);

3 Socket initial Connect Socket initial Accept Send N bytes Close sock connfd N>0 Y N Recv data Disp data Finish? Y N Close socket sockfd ClientServer

4 Please read the source code carefully Try to understand all the function


Download ppt "Data Communications and Networking COMP 2330 Laboratory 5 Mr. Kaiyong Zhao Please sign your name with your attendance."

Similar presentations


Ads by Google