SECTION 10
Host Application Program
6950 Enterprise Gateway Server User’s Guide 10-21
/*
** I’m not doing anything with the incomming data but sending it
** back, thus I build my new output message from the input
** message
*/
sprintf(work_buf,”DBSCQDEL0H16P16/%–16.16s%–16.16s%–16.16s
%–16.16s”,”Enter data now:”,” ”,”Previous data:”,&tdata[1]);
strcpy(tdata,work_buf);
/*
** write the data to the socket
*/
write(curr–>fdin,tdata,strlen(tdata));
return(1);
}
/*
** This function adds a new socket File Descriptor to our
** linked list of connected FDs (which are actually terminals).
*/
int add_fd(unsigned int fd, char *host, char *ip)
{
struct LIST *ptr;
ptr = (struct LIST *)malloc(sizeof(struct LIST));
if(ptr == NULL)
{
printf(”\nnui_sock: add_fd Cannot allocate buf ptr.”);
fflush(stdout);
return(–1);
}
ptr–>fdin = fd;
strcpy(ptr–>ip,ip);
strcpy(ptr–>host,host);
ptr–>next = NULL;
if(tail != NULL)
{
tail–>next = ptr;
tail=ptr;
}
Summary of Contents for 6950 EGS
Page 1: ...6950 Enterprise Gateway Server USER S GUIDE PN 961 047 091 Revision D September 1999 ...
Page 38: ...SECTION 3 Installation 3 22 6950 Enterprise Gateway Server User s Guide ...
Page 44: ...SECTION 4 Connecting to the 6950 EGS 4 6 6950 Enterprise Gateway Server User s Guide ...
Page 74: ...SECTION 5 Configuring Network Options 5 30 6950 Enterprise Gateway Server User s Guide ...
Page 138: ...SECTION 10 Host Application Program 10 24 6950 Enterprise Gateway Server User s Guide ...
Page 144: ...INDEX Index 6 6950 Enterprise Gateway Server User s Guide ...