Socket编程

weltlgit

Ariston

Posted on December 6, 2023

Socket编程

头文件我们过会再看,
首先创建出套接字fd

int server_fd = socket(AN_INET,SOCK_STREAM,0)
//AN_INET代表地址族-因特网,使用ipv4通信协议进行通信,
//SOCK_STREAM 使用TCP进行连接
//0参数代表将默认使用最合适的协议,在上面代码中默认使用TCP进行通信
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
weltlgit
Ariston

Posted on December 6, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related