当端口连接时启动进程
我想创建一个客户端,它可以从同一 LAN 上的许多工作站中的任何一个发出单播数据请求。客户端可能会运行 Linux,但工作站可能运行任何操作系统。是否可以避免在每个工作站上运行守护程序,但让它们在几秒钟内回复请求?我想避免创建守护程序,因为该服务可能不经常使用,并且我不想让另一个进程给工作站带来负担。
I want to create a single client that issues unicast requests for data from any of many workstations on the same LAN. The client will likely run Linux, but the workstations may run any OS. Is it possible to avoid running a daemon on each of the workstations and yet have them reply to requests within a few seconds? I want to avoid creating a daemon because the service may be infrequently used and I don't want to burden the workstations with another process.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看
inetd
的合适实现 适用于您的目标操作系统。该服务监听连接,并通过 stdin/stdout 将实际通信委托给普通 IO 到您的进程实例(根据需要生成):Take a look at suitable implementations of
inetd
for your target operating system. This service listens for connections, and delegates the actual communication to plain IO through stdin/stdout to an instance of your process (which gets spawned on demand):