home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!pageworks.com!world!eff!news.byu.edu!gatech!paladin.american.edu!howland.reston.ans.net!bogus.sura.net!udel!intercon!psinntp!ctp!rsanb
- From: rsanb@ctp.com (Randall Sanborn)
- Subject: MacTCP: MPW C and Think C
- Message-ID: <1993Jan26.202734.20702@ctp.com>
- Sender: news@ctp.com
- Nntp-Posting-Host: looney.ctp.com
- Organization: CTP, Inc.
- Date: Tue, 26 Jan 1993 20:27:34 GMT
- Lines: 49
-
- I am having a problem with the MacTCP TCPSend() function in MPW C 3.2,
- but not in Think C 5.0. The code I had previously written and compiled
- in Think now compiles and links under MPW, but returns an invalidLength
- 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):
-
- #define ASYNC FALSE
-
- foobar(unsigned short len, char *mesg) {
- TCPiopb *tbp; // Both pointers are malloc'd
- wdsEntry *pWds; // and cleared with 0's
-
- pWds->length =len;
- pWds->ptr =mesg;
-
- tbp->tcpStream =TCPstreamPtr;
- tbp->ioCRefNum =TCPRefNum;
- tbp->csCode =TCPSend;
-
- tbp->csParam.send.wdsPtr=(Ptr)pWds;
-
- rc = PBControl((ParmBlkPtr)tbp,ASYNC);
-
- tbp->ioResult
- }
-
- In MPW, I have checked the sizeof() the TCPiopb and the wdsEntry structs,
- they are the same as Think sizeof()'s. There could be some byte-rounding
- problem with this call, but I do not think this is the case, since
- I have checked the first 6 bytes of tbp->csParm.send.wdsPtr. Before
- and just after execution of PBControl, the data seems valid. (2 byte
- length, and 4 byte address for the mesg address).
-
- If anyone has any idea, I would be happy to hear them.
- Also, rc is equal to tbp->ioResult, is this normal?
-
-
- Thank you in advance,
-
- Randy
-
- --
- + /\/\ Randall M. Sanborn (rsanb@ctp.com) +
- | /-/ \ Cambridge Technology Partners |
- | \--/ / 301 Vassar Street |
- + \/\/ Cambridge, MA 02139 +
-