home *** CD-ROM | disk | FTP | other *** search
/ ftp.ncftp.com / ftp.ncftp.com.zip / ftp.ncftp.com / libncftp / libncftp-3.2.5-src.zip / libncftp-3.2.5 / sio / SConnectByName.c < prev    next >
C/C++ Source or Header  |  2003-08-31  |  403b  |  22 lines

  1. #include "syshdrs.h"
  2. #ifdef PRAGMA_HDRSTOP
  3. #    pragma hdrstop
  4. #endif
  5.  
  6. int
  7. SConnectByName(int sfd, const char * const addrStr, const int tlen)
  8. {
  9.     int result;
  10.     struct sockaddr_in remoteAddr;
  11.     
  12.     if (addrStr == NULL) {
  13.         errno = EINVAL;
  14.         return (-1);
  15.     }
  16.  
  17.     if ((result = AddrStrToAddr(addrStr, &remoteAddr, -1)) == 0) {
  18.         result = SConnect(sfd, &remoteAddr, tlen);
  19.     }
  20.     return (result);
  21. }    /* SConnectByName */
  22.