home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / k95source / hosttcp.ksc < prev    next >
Text File  |  2020-01-01  |  1KB  |  40 lines

  1. ; HOSTTCP.KSC
  2. ;
  3. ; Kermit 95 Host-Mode Listener for Incoming TCP/IP Connections.
  4. ; January 1996
  5. ;
  6. ;   Windows 95 can accept multiple simultaneous connections.
  7. ;   Windows NT 3.51 can accept only one at a time.
  8. ;
  9. asg _configfile \freplace(\v(startup)scripts/host.cfg,/,\\)
  10.  
  11. def MAKEVAR2 if def \%2 _assign \%1 \%2, else _assign \%1
  12.  
  13. def MAKEVAR -
  14.   if = \findex(=,\%1,1) 0 end, -
  15.   asg \%9 _\freplace(\%1,=,\32), -
  16.   makevar2 \%9
  17.  
  18. open read \m(_configfile)
  19. if fail forward noconfig
  20. while true { read \%a, if fail break, makevar \%a }
  21.  
  22. if not def _hostport stop 1 Fatal - HOSTPORT not defined.
  23. set network directory           ; No directory lookups
  24. set take echo on
  25. set macro echo on
  26.  
  27. :LOOP
  28. set host * \m(_hostport) /tel  ; Wait for a connection on this port
  29. xif fail { -
  30.   echo K95 Host Mode - Failure to listen on socket \m(_hostport), -
  31.   echo Press a key to exit...,-
  32.   getc \%9,-
  33.   exit 1 -
  34. }
  35. take host.ksc                  ; Execute the host script
  36. msleep 250                     ; Wait for socket to reset
  37. goto loop                      ; Go back and wait for another connection
  38.  
  39. End ; HOSTTCP.KSC
  40.