home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pageworks.com!world!eff!sol.ctr.columbia.edu!usc!davidp
- From: davidp@stealth.usc.edu (David Peterson)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: MacTCP: MPW C and Think C
- Date: 26 Jan 1993 20:41:32 -0800
- Organization: University of Southern California, Los Angeles, CA
- Lines: 35
- Distribution: world
- Message-ID: <1k53psINN3pk@stealth.usc.edu>
- References: <1993Jan26.202734.20702@ctp.com>
- Reply-To: davidp@usc.edu
- NNTP-Posting-Host: stealth.usc.edu
-
-
- In article <1993Jan26.202734.20702@ctp.com>, rsanb@ctp.com (Randall Sanborn) writes:
- |> I am having a problem with the MacTCP TCPSend() function in MPW C 3.2,
-
- |> error on the TCPSend() function. The MacTCP manual states "the total
- |> amount of data described by the WDS was either 0 or greater than 65,535
- |> bytes." I have checked the length member of the wdsEntry structure, and
- |> it is between 0 and 64K bytes. My function is as follows (with some code
- |> extracted):
- |>
-
-
- I think what you need to do is "terminate" your wdsEntry. Try using the
- following macro:
-
- #define WDS(count) struct { \
- wdsEntry block[count]; \
- unsigned short zero; \
- }
-
- MySend(char* somejunk)
- {
- WDS(1) wds;
-
- wds.zero = zero;
- wds.block[0].ptr = somejunk;
- wds.block[0].length = strlen(somejunk);
-
- TCPSend((wdsEntry*) &wds);
- }
-
- I'm not sure why it would work in THINK. I've always used macros like this
- with MacTCP, not sure why, but I've never had the problem you describe.
-
- -dave.
-