1、TCP编程的函数API
1.1、网络发送数据:send()/write()
#include <sys/types.h>
#include <sys/socket.h>
ssize_t send(int sockfd,const void *buf,size_t len,int flags);
#include <unistd.h>
ssize_t write(int fd,const void *buf,size_t count);
send()比write多一个参数flags:
1)flags:
一般填写0,此时和write()作用一样
2)特殊的标志:
- MSG_DONTWAIT:Enables nonblocking operation:非阻塞版本
- MSG_OOB: 用于发送TCP类型的带外数据(out-of-band)
1.2、网络中接收数据:recv()/read()
标签:UDP,int,编程,send,嵌入式,write,flags,MSG,include From: https://blog.csdn.net/qq_22111417/article/details/143926324#include <sys/types.h><