c - 在下面的场景中我是服务器还是客户端?

标签 c networking serial-port udp

所以我有一台电脑通过串行电缆和以太网电缆连接到微 Controller 。最初,PC 通过串行电缆向微 Controller 发送一个字节。这会导致微 Controller 通过以太网电缆发回 UDP 数据报。

我想知道我的电脑上运行的代码应该是服务器还是客户端?

最佳答案

每个维基百科客户端/服务器:

The server component provides a function or service to one or many clients, which initiate requests for such services

和主/从:

Master/slave is a model of asymmetric communication or control where one device or process controls one or more other devices or processes and serves as their communication hub

上面的场景看起来像主/从。在最初的“空闲”情况下,没有“服务器”正在等待(“监听”)请求。只有当 PC 激活微 Controller 时,它们才会开始通信(通过 UDP)。

关于c - 在下面的场景中我是服务器还是客户端?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59209711/

相关文章:

c - C 中的静态成员

ios - 在 iOS 中,我们如何增加每个主机的 HTTP 连接限制?

python - pySerial 程序停止正常工作

winapi - 使用 Windows (XP+) api 发送(串行)中断

javah -jni <classname> 不起作用?

将字符串从指针复制到字符串

c++ - C 和 C++ 中类型的互操作性

java - 调试 RMI 连接

networking - OPENSSL 与 IPSEC

c - 波特率串行窗口端口