Changeset ef55d05 for lib/rtserver.c


Ignore:
Timestamp:
08/04/05 16:16:12 (16 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
77bd94f
Parents:
9e2a109
Message:

Added more help info - fixed major rtserver bug - added a little more documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/rtserver.c

    r9456f1e ref55d05  
    2828        FD_ZERO(&rtserver->rt_fds);
    2929
    30         if ((he=gethostbyname(hostname)) == NULL) {
    31                 perror("gethostbyname");
    32                 return 0;
    33         }
     30        if (hostname) {
     31                if ((he=gethostbyname(hostname)) == NULL) {
     32                        perror("gethostbyname");
     33                        return 0;
     34                }
     35        }
     36       
    3437        if ((rtserver->connect_fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
    3538                perror("socket");
     
    4447        bzero((char *) rtserver->remote, sizeof(rtserver->remote));
    4548        rtserver->remote->sin_family = AF_INET;
    46         rtserver->remote->sin_addr.s_addr = INADDR_ANY;
     49        if (hostname)
     50                rtserver->remote->sin_addr = *((struct in_addr *)he->h_addr);
     51        else
     52                rtserver->remote->sin_addr.s_addr = INADDR_ANY;
    4753        rtserver->remote->sin_port = htons(port);
    4854
     
    5662                return 0;
    5763        }
    58 
     64       
    5965        rtserver->max_rtfds = rtserver->connect_fd;
    6066
Note: See TracChangeset for help on using the changeset viewer.