- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我想创建一个单一的客户端,它从同一 LAN 上的许多工作站中的任何一个发出单播数据请求。客户端可能会运行 Linux,但工作站可能会运行任何操作系统。是否可以避免在每个工作站上运行守护进程,而让它们在几秒钟内回复请求?我想避免创建守护进程,因为该服务可能不常使用,而且我不想让另一个进程给工作站增加负担。
最佳答案
看看 inetd
的合适实现为您的目标操作系统。此服务监听连接,并通过标准输入/标准输出将实际通信委托(delegate)给普通 IO 到您的进程实例(按需生成):
The inetd utility [..] listens for connections on certain internet sockets. When a connection is found on one of its sockets, it decides what service the socket corresponds to, and invokes a program to service the request. The server program is invoked with the service socket as its standard input, output and error descriptors. After the program is finished, inetd continues to listen on the socket [..]
关于tcp - 当端口连接到时启动进程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3857469/
所以我有一个在 Heroku 中运行的 Java 应用程序,它总是在监听某些内容。它不应该被 ping 到,但如果被 ping 到,它会返回一个 H20 错误,因为该过程永远不会结束。我怎样才能防止这
我是一名优秀的程序员,十分优秀!