Thanks..

 Now shows the error 4628 which is netErrSocketClosedByRemote when i call
this function NetLibSocketConnect()..
NetLibSocketOpen() this function works fine.. err value is 0.. is there any
thing has to be done to open the socket.. why this error
(netErrSocketClosedByRemote) occurs ? 

Have any one encountered this problem before... any idea..


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Eduardo Orea
Sent: Tuesday, February 19, 2008 11:47 AM
To: Palm Developer Forum
Subject: Re: netErrParamErr

Geetha Arasu, I'm assuming that you successfully opened both the library 
and the socket, it's hard to tell without code samples of what are you 
doing.

This is what I do when I use NetLibSocketConnect(), this code was inside 
a function and it's fully functional.

----- CODE SAMPLE -----
UInt16 AppNetRefnum // Got from library opening
NetSocketRef socket // Got from socket opening
Int32 AppNetTimeout = ( 6 * SysTicksPerSecond () ) // 6 sec timeout

Int16                   AddrLength;
NetSocketAddrINType     Addr;
NetHostInfoBufPtr       bufP;
NetHostInfoPtr          infoP;
Err                     err;
        
AddrLength = sizeof(Addr);
MemSet ((char *) &Addr, AddrLength, '\0');
Addr.family = netSocketAddrINET;
Addr.port = NetHToNS (8080);
bufP = (NetHostInfoBufPtr) MemPtrNew (sizeof (NetHostInfoBufType));
infoP = NetLibGetHostByName(AppNetRefnum, "127.0.0.1", bufP, 
AppNetTimeout, &err);
Addr.addr = (NetIPAddr)NetHToNL((*(NetIPAddr *) infoP->addrListP[0]));
MemPtrFree (bufP);

NetLibSocketConnect(AppNetRefnum, socket, (NetSocketAddrType*) &Addr, 
sizeof(Addr), AppNetTimeout, &err);
if (err)
{
        return err;
}
        return errNone;
}
----- CODE SAMPLE -----

Hope this help you out.

Eduardo Orea


Geetha Arasu escribió:
> Hi ..
> 
>     I am writing a client network application using NetMgr.h. i am using
> treo 680 simulator.
>  while using the Function NetLibsocketConnect , every time gives me an
error
> - netErrParamErr ...
> The error-The specified index is out of range or there is no configuration
> at the index. 
> dont have an idea about it...
>             could anyone suggest me what could be the reason for that
> error..
> 
> 
> 

-- 
For information on using the ACCESS Developer Forums, or to unsubscribe,
please see http://www.access-company.com/developers/forums/



-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to