计算机网络:socket
生活随笔
收集整理的這篇文章主要介紹了
计算机网络:socket
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
UDP變成 C/S架構
?
?
#include<stdlib.h> #include<stdio.h> #include<sys/types.h> #include<sys/socket.h>int main(){// 使用socket函數創建套接字// 創建一個用于udp網絡編程的套接字int sockfd = socket(AF_INET, SOCK_DGRAM,0);printf("socket文件描述符%d\n",ret);if(sockfd == -1){perror("fail to socket");exit(1);}return 0; }?
總結
以上是生活随笔為你收集整理的计算机网络:socket的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 计算机网络:大小端存储
- 下一篇: 计算机网络:socket-udp