Redian新闻
>
a question about inetd server programming
avatar
a question about inetd server programming# Unix - 噫吁兮,危乎高哉
p*e
1
I am using inetd mechanism to build a server, ie, I am trying to avoid socket
stuff.
Now the question is if it is possible for me to know who is connecting to my
server. I mean something like client's address. I know it is possible if I use
Socket directly.
avatar
w*n
2

Yes, fd 0, 1, and 2 should be dup'ed fom the original socket returned from
accept. call getpeername on fd 0 for remote addr and port, and getsockname
for local addr and port.

【在 p******e 的大作中提到】
: I am using inetd mechanism to build a server, ie, I am trying to avoid socket
: stuff.
: Now the question is if it is possible for me to know who is connecting to my
: server. I mean something like client's address. I know it is possible if I use
: Socket directly.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。