我正在尝试了解更多套接字。所以我在头文件socket.h
中,在sys库中找到了一些函数声明bind(), connect()
,但是我没有找到它们的定义?我在哪里可以找到它?
告诉我这个问题是否不相关,我将把它移到别处
You're really suggested to read Beej's guide to network programming to make sense of these functions. Manpages (-S2) will help too.
The source code of the function (if that's what you hope to find) won't help a lot. They call system calls to do their job, as they're mostly OS-abstraction layer. What you need is their documentation.
我建议您查看http://www.linuxhowtos.org/C_C++/socket.htm以了解有关套接字的更多信息。
您不会在标题中找到它们的定义,您需要深入了解您的 libc。但是你也不会在那里找到任何真正有用的东西,因为那些是系统调用,所以你真的需要挖掘你的内核。