Yes, I'm doing all that in the same order! When I use the NetLibSocketAccept , 
my device keeps waiting for a connection and I try to connect using: 
Socket socket = new Socket(ipAddress, port);

socket.writeBytes(text);

socket.close();

But it doesn't work! :(

  ----- Original Message ----- 
  From: [EMAIL PROTECTED] 
  To: Palm Developer Forum 
  Sent: Thursday, February 28, 2008 3:05 PM
  Subject: Re: Server sockets (Treo 650)



  According to the documentation: 
  Accepts the next connection request from a remote client. This call is only 
applicable to stream-based sockets. Before calling NetLibSocketAccept on a 
socket, a server application needs to: 
    a.. Open the socket (NetLibSocketOpen()). 
    b.. Bind the socket to a local address (NetLibSocketBind()). 
    c.. Set the maximum pending connection-request queue length 
(NetLibSocketListen()). 
  NetLibSocketAccept will block until a successful connection request is 
obtained from a remote client. After a successful connection is made, this call 
returns with the address of the remote host in *sockAddrP and the socket 
descriptor of a new socket as the return value. You then use the new socket to 
send and receive data. 

  If you're doing all that and in the same order then I would look to your 
client?


  /**************************************************
  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:54 AM Please respond to
              "Palm Developer Forum" <[email protected]> 


       To "Palm Developer Forum" <[email protected]>  
              cc  
              Subject Re: Server sockets (Treo 650) 

              

       



  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/ 




------------------------------------------------------------------------------


  "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/

Reply via email to