home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / k95 / hosttcp.ksc < prev    next >
Text File  |  2020-01-01  |  2KB  |  61 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.  
  10. ; The following code was added to accomodate the new Windows multi-user
  11. ; friendly directory layouts introduced with version 1.1.21.  We have
  12. ; check several locations for the directories that hostmode uses and
  13. ; create them in \v(appdata) if the do not exist at all.
  14.  
  15. if directory \v(exedir)USERS {
  16.     asg _hostroot \v(exedir)
  17.     forward FOUNDDIRS
  18. }
  19. if directory \v(startup)INCOMING {
  20.     asg _hostroot \v(startup)
  21.     forward FOUNDDIRS
  22. }
  23.  
  24. if directory \v(appdata)USERS {
  25.     asg _hostroot \v(appdata)
  26. }
  27.  
  28. :FOUNDDIRS
  29.  
  30. asg _configfile \freplace(\m(_hostroot)/host.cfg,/,\\)
  31.  
  32. def MAKEVAR2 if def \%2 _assign \%1 \%2, else _assign \%1
  33.  
  34. def MAKEVAR -
  35.   if = \findex(=,\%1,1) 0 end, -
  36.   asg \%9 _\freplace(\%1,=,\32), -
  37.   makevar2 \%9
  38.  
  39. open read \m(_configfile)
  40. if fail forward noconfig
  41. while true { read \%a, if fail break, makevar \%a }
  42.  
  43. if not def _hostport stop 1 Fatal - HOSTPORT not defined.
  44. set network directory           ; No directory lookups
  45. set take echo on
  46. set macro echo on
  47.  
  48. :LOOP
  49. set host * \m(_hostport) /tel  ; Wait for a connection on this port
  50. xif fail { -
  51.   echo K95 Host Mode - Failure to listen on socket \m(_hostport), -
  52.   echo Press a key to exit...,-
  53.   getc \%9,-
  54.   exit 1 -
  55. }
  56. take host.ksc                  ; Execute the host script
  57. msleep 250                     ; Wait for socket to reset
  58. goto loop                      ; Go back and wait for another connection
  59.  
  60. End ; HOSTTCP.KSC
  61.