1: static char sccsid[] = "@(#)listen.c	4.1	(Berkeley)	10/2/82";
   2: 
   3: /*
   4: 	listen.c
   5: 
   6: 	listen for a packet from the program interact.c and print it
   7: */
   8: # include "defs.h"
   9: main(argc,argv)
  10:       char **argv;
  11: {
  12:     struct packet *pp;
  13:     char buf[BUFSIZ];
  14:     setupdaemon(argc,argv);
  15:     initseqno();
  16:     putchar('!');
  17:     fflush(stdout);
  18:     for(;;){
  19:         pp = getpacket();
  20:         printpacket(pp,buf);
  21:         printf("got %s\n",buf);
  22:         if(pp == NULL )continue;
  23:         pp->pcode = ACK;
  24:         pp->len = 0;
  25:         sendpacket(pp);
  26:         printpacket(pp,buf);
  27:         printf("sent %s\n",buf);
  28:     }
  29: }

Defined functions

main defined in line 9; never used

Defined variables

sccsid defined in line 1; never used
Last modified: 1982-10-03
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 535
Valid CSS Valid XHTML 1.0 Strict