1

I have an app running as a daemon on a linux box (Red Hat). The purpose of the app is to act as a registrar of sorts -- another device can connect to this host machine, and register (this is me, I am here -- this kind of thing). There is more than one IP address for this machine.

How do I connect/send/forward incoming connections (i.e., the registration data) to my daemon? That is, when the device wants to register and connects to my IP address, how do I direct the traffic to my process/daemon?

Thank you very much for all your help!

:bp:

4

1 回答 1

0

嗨,您可能需要提供更多信息。

听起来你想做的是用你的守护进程监听一个 tcp 端口。在不同的语言中有不同的方法可以做到这一点。

另一件需要注意的是保留的端口范围。某些端口只能由具有提升权限的用户使用。请参阅此处http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers TCP 和 UDP 端口范围,只要该端口上没有其他内容,它们的动态范围就可以免费使用。

您使用什么语言?在 Perl中,就是你听的方式。我可以列出其他语言的其他教程,但没有多大意义。

针对评论,我认为这个stackoverflow 问题回答了这个问题。

于 2013-03-06T22:32:35.627 回答