Am 13.06.2005 um 09:37 schrieb Stephen Deasey:
Ns_SockListenTcp() should probably replace Ns_SockListenEx() with it's backlog parameter? The passed backlog should be checked, and if it's < 1, use the default from the config file. If this is the new recommended way to listen on sockets, I'd update all callers of the old Ns_SockListen(Ex) functions. People will cut 'n paste old code and continue the confusion.
Well, I have left the Ns_SockListenEx() untouched. We might rename it to Ns_SockListenTcp() to be more consistent but I did not want to do that yet because I do not know what side-effects this may have.
Hmm, Ns_SockListenUnix() doesn't actually call listen(). Is this right? Also, is a backlog parameter appropraite here, as in Ns_SockListenEx()?
No, it does not. It just binds. As well as the raw sockets; Ns_SockBindRow does not bind. It just creates the socket. I did not want to add complete confusion so I followed the TCP way: ListenXXX BindXXX where XXX = Unix, Raw and Listen Bind is reserved for TCP. The only real exception is Ns_SocketListenEx which just adds one additional (backlog) parameter. Admitently, some calls are real misnomers as I already documented in the funciton comment: * * Ns_SockBindRaw -- * * Create a raw socket. It does not bind, hence the call name * is not entirely correct but is on-pair with other types of * sockets (udp, tcp, unix). * In the process of cleanup, we might rectify/improve this and give the calls more meaningful names.
You can decalare Ns_BindSock() NS_GNUC_DEPRECATED and no one else need be confused :-)
This is OK. I will do that. Zoran