Background:
I have written a Java Server, that should receive and send data to a
Palm Pilot using TCP Streams.
What Currently Works (Assumptions):
I am able to get a ref to the library, open a socket, and successfully
send data (strings) using two calls to NetLibSend from the Palm to my
Java Server. Proof of success is that on the Java Server side, I
printed the strings to standard out, and they were the correct strings
sent by the Palm.
What Doesn't Work:
When I try the NetLibReceive Call, to receive a string from my Java
Server, I am getting the "netErrParamErr"
I want to receive a string using the NetLibReceive Call. I am providing
a sample extract of the relevant code. Can you please tell me what I am
doing wrong.
Extract from Function Call...
Err err;
Word AppNetRefnum;
NetSocketRef netSockRef;
VoidHand hPYBServerReceiveAuth;
CharPtr PYBServerReceiveAuthP;
Word fromLen;
NetSocketAddrINType socketAddrRec ;
SDWord AppNetTimeout;
/*
Code used to get ref to library (find and open), open socket, connect,
and send data is not shown.
Functions Used: SysLibFind, NetLibOpen, NetLibSocketOpen,
NetLibSocketConnect, NetLibSend
*/
//10 seconds
AppNetTimeout = SysTicksPerSecond() * 10;
fromLen = sizeof(NetSocketAddrINType);
hPYBServerReceiveAuth = MemHandleNew(32);
PYBServerReceiveAuthP = MemHandleLock (hPYBServerReceiveAuth);
okNetLibCall = NetLibReceive (AppNetRefnum, netSockRef,
PYBServerReceiveAuthP, 32, 0, (NetSocketAddrType*) &socketAddrRec,
&fromLen , AppNetTimeout, &err);
if (okNetLibCall <= 0)
{
FrmCustomAlert(CommunicationErrorAlert,"Failed to Receive Server
Authentication Ack.","","");
FrmCustomAlert(DebugAlert,"From Receive Server
Authentication:",CheckNetworkErrorMsg(err),"");
}
err = MemHandleUnlock (hPYBServerReceiveAuth);
err = MemHandleFree (hPYBServerReceiveAuth);
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/