Yo can try to read the socket, if it gives a 0 in
bytes received it means the connection is broken. It
says so in the PalmReference.pdf
You can use the netIOFlagPeek flag to read from the
socket but not erase the data from the buffer.
msg = MemPtrNew(len);
size =
NetLibReceive(AppNetRefnum,sock,msg,len,netIOFlagPeek,0,0,0,&errno);
if (size == 0)
{
close_connection();
}
MemPtrFree(msg);
--- Aaron Yang <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have some questions about checking the socket
> connection. I'm
> developing an app which has to connect to a server
> through socket.
> Sometimes the server will break the connection
> without giving any
> message and I can't send any packet through this
> socket, cus' it has
> been disconnected. If I try to verify the connection
> by sending
> packets, the server will disconnect immediately. How
> can I check the
> connection without sending any packet?? I've read
> all the NetLib APIs
> but still do not know how to do.
>
> Rgds,
> Aaron
>
>
>
> --
> For information on using the Palm Developer Forums,
> or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/