Hi Keith & Randy,
I searched low then high and back to low and found a working example piece
of code. And guess what, NO UInt16 's !
int port;
UInt NetLibOpenRef;
int theSocket;
short SocketReceiveErr;
char* msg;
int size;
int recv = NetLibReceive(NetLibOpenRef,theSocket,
(BytePtr)msg, size,0,0,0,-1,
&SocketReceiveErr);
Alex
----- Original Message -----
From: Alex R <[EMAIL PROTECTED]>
To: Palm Developer Forum <[EMAIL PROTECTED]>
Sent: Wednesday, January 31, 2001 4:40 PM
Subject: Re: NetLibReceive, I am getting the "netErrParam Err".
> Thanks for the reply Randy, but unfortunately I get the same result. I
just
> started debugging on the pose for the reasons you stated below. And as a
> result, I have changed my code tremendously for the better. But I am
stumped
> with this problem. I have checked archives for example netlibreceive code,
> but with no luck. If you or anyone else would be kind enough to post an
> example of a netlibreceive call, I sure would appreciate it.
>
> Thanks,
>
> Alex
>
>
> ----- Original Message -----
> From: Randy Maxwell <[EMAIL PROTECTED]>
> To: Palm Developer Forum <[EMAIL PROTECTED]>
> Sent: Wednesday, January 31, 2001 4:23 PM
> Subject: RE: NetLibReceive, I am getting the "netErrParam Err".
>
>
> > 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
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/