I sponsored a topic in stackoverflow.com, and hoped the programmers can share the socket programming tips in different UNIX flavors. But unfortunately, the responders are few. So I can only share my socket programming tips in Solaris at here (the Chinese version can be found there):
1. Use the following link options: "-lresolv -lnsl -lsocket";
2. Solaris doesn't provide socket options: SO_SNDTIMEO and SO_RCVTIMEO(Why does Solaris OS define SO_SNDTIMEO and SO_RCVTIMEO socket options in header file which actually not support by kernel?);
3. In SCTP programming, must call bind() before calling sctp_bindx()(sctp_bindx(Solaris sctp library) always return "Invalid argument");
4. When calling shutdown() on a listen socket, it will cause ENOTCONN error(Why shutdown a socket can't let the select() return?).
Socket编程技巧

本文分享了在Solaris系统中进行Socket编程的一些实用技巧,包括链接选项的使用、不支持的Socket选项说明、SCTP编程中bind与sctp_bindx的正确调用顺序,以及shutdown在监听套接字上使用的注意事项。
2163

被折叠的 条评论
为什么被折叠?



