Dharini,

Several things occur to me after reading your more complete problem report:

* It's still not clear to me how the serial link manager fits in to 
this.  What log file are you talking about?  What's making serial 
link manager calls?  Why do you think they're related to the NetLib 
operations?

* You're not doing a lick of error checking!  After making NetLib 
calls, check the various errno and errP variables you're using.

* Using errno to receive error values is bad.  That's a Std C Library 
variable that you should be treating as read-only.

* Using &errP seems confusing to me.  The name "errP" indicates that 
the variable is a pointer to another variable, probably of type Err. 
Thus, "&errP" is a pointer to a pointer to an Err.  And that's not 
what you want.

* You don't say what call is causing the timeout in the client.

* Finally, I may be misreading this, but it looks like your server is 
binding to port 1234, while your client is attempting to connect to 
port 2345.  I'd think that these should be the same port numbers.

Hope this helps,

-- Keith Rollin
-- Palm OS Emulator engineer


At 11:34 AM -0800 4/4/02, Dharini Iyengar wrote:
>After going through my email I realized that Keith was right. So 
>here is what we have already done.
>
>We have the server running on one machine,for this we open a socket, 
>bind it to a port and then listen on that port. For starters we 
>decided to run only the server on one machine and the client on the 
>other.
>
>The server does "listen", but the client seems to be not sending 
>anything. The client gives a 4626 which is a time out error. We have 
>defined timeout as -1,which is forever.
>
>The log files give the Serial Link Manager errors
>
>       CmdWriteRemoteMem: error in SlkSendPacket = Error code: 00AA
>       CmdWriteRemoteMem: error in SlkReceivePacket = Error code: 030B
>
>in both the client and the server.
>
>This is the crux of our Server code
>
>MasterSocket = NetLibSocketOpen (AppNetRefnum,PF_INET,SOCK_STREAM,
>IPPROTO_TCP,-1,&errno);
>
>AddrLength = sizeof(Addr);
>bzero ((char *) &Addr, AddrLength);
>Addr.family = AF_INET;
>Addr.port = htons (1234);
>Addr.addr=NetLibAddrAToIN(AppNetRefnum,a);
>
>NetLibSocketBind (AppNetRefnum, MasterSocket, (NetSocketAddrType
>*)&Addr,sizeof(struct sockaddr_in), AppNetTimeout, &errno);
>
>RetVal=NetLibSocketListen (AppNetRefnum, MasterSocket,1,AppNetTimeout,
>&errno);
>
>And this is what the client does..
>
>ClientSocket = NetLibSocketOpen
>(AppNetRefnum,AF_INET,SOCK_STREAM,0,-1,&errno);
>
>
>ServerAddrLength = sizeof(ServerAddr);
>bzero ((char *) &ServerAddr, ServerAddrLength);
>ServerAddr.family = AF_INET;
>ServerAddr.port = htons (2345);
>ServerAddr.addr=NetLibAddrAToIN(AppNetRefnum,b);
>
>
>AddrLength = sizeof(Addr);
>bzero ((char *) &Addr, AddrLength);
>Addr.family = AF_INET;
>Addr.port = htons (1234);
>Addr.addr=NetLibAddrAToIN(AppNetRefnum,a);
>
>ClientConnected=NetLibSocketConnect(AppNetRefnum,ClientSocket,(NetSocketAddrType
>*)&ServerAddr,/*ServerAddrLength*/sizeof(struct sockaddr_in), -1,&errP);
>
>RetVal = NetLibSend (AppNetRefnum, NewSocket,&buffer,
>bufferLen,0,0,0,AppNetTimeout , &errno);
>
>I hope this helps you help us!!


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to