Alex,
As Keith suggests...
try this:
UInt16 size;
size = sizeof(ForeignAddrType);
recv = NetLibReceive(NetLibOpenRef, theSocket,msg, size,0,
(NetSocketAddrType *)&ForeignAddrType,
&size, // Changed
-1,&SocketReceiveErr);
The release ROMs on actual devices do not have all the checks that Debug
ROMs do.
The Debug ROMs and POSE helps you to catch errors early rather than having
them go unknown on actual devices until the situation is _really_ in bad
shape...
Regards,
Randy Maxwell
-----Original Message-----
From: Alex R [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 31, 2001 6:58 AM
To: Palm Developer Forum
Subject: Re: NetLibReceive, I am getting the "netErrParam Err".
Hi Kieth,
The parameters that I'm using are:
Word NetLibOpenRef;
NetSocketAddrINType ForeignAddrType;
NetSocketRef theSocket;
SWord recv;
short SocketReceiveErr;
CharPtr msg;
Word size,
recv = NetLibReceive(NetLibOpenRef, theSocket,msg, size,0,
(NetSocketAddrType *)&ForeignAddrType,
(WordPtr)sizeof(ForeignAddrType),
-1,&SocketReceiveErr);
I have also tried the following:
recv = NetLibReceive(NetLibOpenRef, theSocket,msg, size,0,
(NetSocketAddrType *)&ForeignAddrType,
(UInt16*)sizeof(ForeignAddrType),
-1,&SocketReceiveErr);
and:
VoidHand hTest;
VoidPtr pTest;
hTest = MemHandleNew(size);
pTest = MemHandleLock(hTest);
recv = NetLibReceive(NetLibOpenRef, theSocket, pTest, size,0,
(NetSocketAddrType *)&ForeignAddrType,
(UInt16*)sizeof(ForeignAddrType),
-1,&SocketReceiveErr);
MemHandleUnlock(hTest);
MemHandleFree(hTest);
////////////////////////////////////////////////////////
Again, using the emulator the NetLibReceive call returns a netErrParam Err??
It works on the actual device.
Alex
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: Palm Developer Forum <[EMAIL PROTECTED]>
Sent: Tuesday, January 30, 2001 7:17 PM
Subject: Re: NetLibReceive, I am getting the "netErrParam Err".
>
>
> Dude...you want us to figure out why you're getting a netErrParamErr, yet
you
> don't even show us your parameters???
>
> I know that one thing is wrong: you're lying to NetLibReceive with regards
to
> the fromLenP parameter. It wants a _pointer_ to a UInt16. You're passing
in
> just a UInt16! Just because you cast it to a UInt* doesn't make it a
UInt16*.
>
> -- Keith Rollin
> -- Palm OS Emulator engineer
>
>
>
>
>
>
> "Alex R" <[EMAIL PROTECTED]> on 01/30/2001 06:03:58 AM
>
> Please respond to "Palm Developer Forum" <[EMAIL PROTECTED]>
>
> Sent by: "Alex R" <[EMAIL PROTECTED]>
>
>
> To: "Palm Developer Forum" <[EMAIL PROTECTED]>
> cc: (Keith Rollin/US/PALM)
> Subject: NetLibReceive, I am getting the "netErrParam Err".
>
>
>
> Hello All,
>
> When I debug using the emulator, the NetLibReceive call returns a
> netErrParam error. The code below works fine on the actual device.
>
> /////////////////////////////////////////////////
>
> SWord recv;
> short SocketReceiveErr;
> CharPtr msg;
>
> MemSet(msg,size,'\0');
> recv = NetLibReceive(NetLibOpenRef,theSocket,msg, size,0,
> (NetSocketAddrType *)&ForeignAddrType,
> (unsigned short
> *)sizeof(ForeignAddrType),-1,&SocketReceiveErr);
>
> /////////////////////////////////////////////////
>
> Any help will be much appreciated.
>
>
> Alex
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please
> see http://www.palmos.com/dev/tech/support/forums/
>
>
>
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
>
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/