home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 22193 < prev    next >
Encoding:
Text File  |  1993-01-26  |  1.9 KB  |  42 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!dtint!tom
  3. From: tom@dtint.uucp (Thomas R. Kimpton)
  4. Subject: Re: MacTCP - getservbyname code, anyone?
  5. Message-ID: <1993Jan22.185307.20294@dtint.uucp>
  6. Organization: Digital Technology, International
  7. References: <bobert.727074187@godzilla> <1j73beINN78i@stealth.usc.edu> <bobert.727567325@godzilla>
  8. Date: Fri, 22 Jan 93 18:53:07 GMT
  9. Lines: 31
  10.  
  11. I've thought, and I'm sure others have, about writing an "inetd"
  12. program for the mac that would provide services on the mac.  It
  13. would have a services file that had the service name, protocol
  14. (UDP/TCP), port number, and program to launch.  However, I came
  15. across a major snag:  When you create a MacTCP stream you have
  16. to give it a buffer for input buffering.  There is no provision
  17. for replacing the existing buffer with a new one. This means that
  18. if I want to have my program setting on a port, then hand that
  19. port to another program, the memory buffer will come from
  20. my heap, and if I quit, the buffer I handed off with the
  21. stream is no longer valid.  While it's possible to do, it wouldn't
  22. be convenient, as MacTCP's minimum buffer size is 4K (I'm not
  23. sure if this is recommended or mandatory) and some protocols
  24. suck wind if they have such small buffers, but with 64 streams
  25. available, the partition size for this program would really
  26. crank up in size for a program who's sole purpose is to had off
  27. connections to other programs.  Again, it would be possible to
  28. create streams for specific ports, with appropriate buffer sizes,
  29. but it wouldn't be general enough.  The most general approach
  30. involves listening at port 0, host 0.0.0.0 as this catches
  31. incoming connections on any port, from any host.  But with
  32. no provision for resizing the input buffer ....
  33.  
  34. Tom.
  35.  
  36.  
  37. -- 
  38. ---
  39. Tom Kimpton                            tom@dtint.dtint.com
  40. Digital Technology Int.                (801)226-2984    
  41. 500 W. 1200 South, Orem UT, 84057      FAX (801) 226-8438
  42.