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