home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 22270 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  1.4 KB

  1. Path: sparky!uunet!pageworks.com!world!eff!sol.ctr.columbia.edu!usc!davidp
  2. From: davidp@stealth.usc.edu (David Peterson)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: MacTCP: MPW C and Think C
  5. Date: 26 Jan 1993 20:41:32 -0800
  6. Organization: University of Southern California, Los Angeles, CA
  7. Lines: 35
  8. Distribution: world
  9. Message-ID: <1k53psINN3pk@stealth.usc.edu>
  10. References: <1993Jan26.202734.20702@ctp.com>
  11. Reply-To: davidp@usc.edu
  12. NNTP-Posting-Host: stealth.usc.edu
  13.  
  14.  
  15. In article <1993Jan26.202734.20702@ctp.com>, rsanb@ctp.com (Randall Sanborn) writes:
  16. |> I am having a problem with the MacTCP TCPSend() function in MPW C 3.2, 
  17.  
  18. |> error on the TCPSend() function.  The MacTCP manual states "the total 
  19. |> amount of data described by the WDS was either 0 or greater than 65,535 
  20. |> bytes."  I have checked the length member of the wdsEntry structure, and 
  21. |> it is between 0 and 64K bytes.  My function is as follows (with some code
  22. |> extracted):
  23. |> 
  24.  
  25.  
  26. I think what you need to do is "terminate" your wdsEntry. Try using the 
  27. following macro:
  28.  
  29. #define WDS(count) struct {        \
  30.     wdsEntry    block[count];    \
  31.     unsigned short    zero;        \
  32. }
  33.  
  34. MySend(char* somejunk)
  35. {
  36.     WDS(1)    wds;
  37.  
  38.     wds.zero = zero;
  39.     wds.block[0].ptr = somejunk;
  40.     wds.block[0].length = strlen(somejunk);
  41.  
  42.     TCPSend((wdsEntry*) &wds);    
  43. }
  44.  
  45. I'm not sure why it would work in THINK. I've always used macros like this
  46. with MacTCP, not sure why, but I've never had the problem you describe.
  47.  
  48. -dave.
  49.