Hello!
I have a really problem with sockets. 
I am writing an application an I want to load a
Database in my PDA using sockets (tcp/ip connection)
to do that i do:

** open socket and connect: with following function 

socketfd=NetUTCPOpen("192.168.220.174",NULL,6001);
where the first parameter is the ip address for the
database host, Null is no service, and 6001 is the
application's port.

(I had tried it too with socket(AF_INET, SOCK_STREAM,
0) and connect(fd, (struct sockaddr *)
&tcp_srv_addr,sizeof(tcp_srv_addr)) functions)

** send a SQL request to the database, case of socket
connection has been established.with following
function:
NetUWriteN (socketfd,(UInt8*)outbuff2,outbytes2)
where outbuff is a Char* to the SQL string.

** recive the database SQL answer.with the following
funciton:
recvfrom(socketfd, inbuff,20000, 0,(struct sockaddr *)
0, (int *) 0)

** close socket
close(socketfd);
socketfd=-1;

The problem is that sometimes Fatal Exeception errors
occurs, and i dont know why.
if i load it with the debugg into the pda, sometimes
all works succesfully, but other times, a fatal error
occurs, and the app. exits. in this case, the fatal
error occurs exiting the application. and the next
time we launch the app, the connection can not be
established.

if it is loaded with hotsync, never the connection is
established, because when the socket try to open the
error occurs.

I have probed to shutdown the socket too, and i have
set the linger to zero too. but the problem stills.
my pda is a HAndspring visor edge, with palm os.
version  3,5. 
 
i hope somebody could help me!!
thanks in advanced
ana


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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

Reply via email to