The bind method of class Socket returns 1 for error or returns the value
from the bind() from the C socket library which may be -1 on error.

Should I write a patch which re-writes the comments for each method for use
with doxygen ?

About the test case for class Socket: should i write a different method for
each variety of arguments ? For example:

void testGethostbynameAfInet ( );

void testGethostbynameAfInet6();

// ??
Index: socket.cpp
===================================================================
--- socket.cpp  (revision 3027)
+++ socket.cpp  (working copy)
@@ -160,14 +160,14 @@
 int Socket::bind(MYSERVER_SOCKADDR* sa,int namelen)
 {
    if ( sa == NULL || (sa->ss_family != AF_INET && sa->ss_family != AF_INET6) )
-      return 1;//Andu: TODO our error code or what?
+      return -1;
   if ( (sa->ss_family == AF_INET && namelen != sizeof(sockaddr_in)) 
 #if HAVE_IPV6
   || (sa->ss_family == AF_INET6 && namelen != sizeof(sockaddr_in6))
 #endif
  )
 
-     return 1;//Andu: TODO our error code or what?
+     return -1;
 #ifdef WIN32
   return ::bind((SOCKET)socketHandle,(const struct sockaddr*)sa,namelen);
 #endif

Reply via email to