What it looks like to me is that it's not accepting
the connection because it has already passed that
point in the code when you try to connect from your
Java client.

Since you set the socket to be non-blocking, when you
do the accept, it doesn't see a connection waiting,
and since it's non-blocking, it proceeds on to the
next line of code.

You can try removing the non-blocking set (just as a
temporary test) and see if it will accept the
connection then.

Ultimately, you'll want some kind of loop to
constantly check for and accept incoming connections.

--- Kelly Leal <[EMAIL PROTECTED]> wrote:

> Thanks for your answer, but when I call
> NetLibSocketAccept, I get netErrTimeout. He's what
> I'm doing: 
> 
> newSock = NetLibSocketAccept(serverSock, &sockAddr,
> &addrLen, wait, &err). I've already tried to use
> wait = -1 in order to keep waiting forever, but
> nothing happens!!!
> 
> I've already looked at these examples, thank you,
> but they didn't help me so much.. :(
>   ----- Original Message ----- 
>   From: [EMAIL PROTECTED] 
>   To: Palm Developer Forum 
>   Sent: Thursday, February 28, 2008 2:39 PM
>   Subject: Re: Server sockets (Treo 650)
> 
> 
> 
>   Yes, I believe you have to accept the connection. 
> You can take a look at
>
http://kb.palmsource.com/cgi-bin/palmsource.cfg/php/enduser/std_adp.php?p_faqid=21
> 
>   for a few examples. 
> 
> 
> 
>  
> /**************************************************
>   Heath Schaefer
>   Product Engineer
>   Sporlan Division, Parker Hannifin Corporation
>   636.239.7711 x243
>  
> **************************************************/ 
> 
> 
>         "Kelly Leal" <[EMAIL PROTECTED]> 
>         Sent by: [EMAIL PROTECTED]
> 
>         02/28/2008 11:30 AM Please respond to
>               "Palm Developer Forum"
> <[email protected]> 
> 
> 
>        To "Palm Developer Forum"
> <[email protected]>  
>               cc  
>               Subject Server sockets (Treo 650) 
> 
>               
> 
>        
> 
> 
> 
>       I'm trying to create a server socket (using
> Treo 650) but I'm not getting success! Here is part
> of my code: 
>     
>      socketRef = NetLibSocketOpen(netSocketAddrINET,
> netSocketTypeStream, netSocketProtoIPTCP, wait,
> &err);
>     if (err != errNone)
>        return err; 
>     
>      NetLibSocketBind(socketRef,
> (NetSocketAddrType*) &addrIN, sizeof(addrIN), wait,
> &err);
>     if (err != errNone)
>        return err; 
> 
>     NetLibSocketOptionSet(socketRef,
> netSocketOptLevelSocket,
> netSocketOptSockNonBlocking, &Value, sizeof(Value),
> wait, &err);
>     if (err != errNone)
>        return err; 
>     
>      NetLibSocketOptionSet(socketRef,
> netSocketOptLevelTCP, netSocketOptTCPNoDelay,
> &Value, sizeof(Value), wait, &err);
>     if (err != errNone)
>        return err; 
>     
>      NetLibSocketListen(socketRef, backlog, wait,
> &err);
>     if (err != errNone)
>        return err; 
>       
>      // That's how I'm getting the IP address 
>      if((err =
> NetLibSettingGet(netIFSettingActualIPAddr,
> &dhcpPPPAddress, &bufSize)) == errNone)
>        alert("%d", dhcpPPPAddress);
>     NetLibAddrINToA(dhcpPPPAddress, buf);
>     alert(buf); 
>     
>      I get the IP Address here and try to connect to
> it, using a Java program, but I get the exception
> java.net.ConnectException: Connection timed out:
> connect. 
>     All the functions above are working (they're
> returning errNone), but I don't know how to test it,
> to make sure that's working well! What about the
> NetLibSocketAccept? Shouldn't I use it too? 
>      Can anybody help me? Thanksssssssssss in
> advance!:) 
>     
>       Kelly 
>       
> 
>   -- 
>   For information on using the ACCESS Developer
> Forums, or to unsubscribe, please see
> http://www.access-company.com/developers/forums/ 
> 
> 
> 
>
------------------------------------------------------------------------------
> 
> 
>   "PLEASE NOTE: The preceding information may be
> confidential or privileged. It only should be used
> or disseminated for the purpose of conducting
> business with Parker. If you are not an intended
> recipient, please notify the sender by replying to
> this message and then delete the information from
> your system. Thank you for your cooperation." 
> 
> -- 
> 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/



      
____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

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

Reply via email to