Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用以下代码发送响应:
//s is Accepted Client char* buf = "0x11"; send(s, buf, 8, 0);
我有一些文件说明:
对于每个传入的数据包,服务器必须接收确认字节(表示该数据包已成功接收):0x11
0x11
我是系统编程的新手(我是一名网络开发人员);你能帮我理解如何发送一个字节包吗?
您可能只需要发送一个字节:
char byte = 0x11; send(s, &byte, 1, 0);
或作为一个班轮:
send(s, "\x11", 1, 0);