At 03:15 AM 2/13/2007, you wrote:
Subject: How to write Instant Messager Client work in background
From: "Evan" <[EMAIL PROTECTED]>
Date: Tue, 13 Feb 2007 07:45:21 -0000
X-Message-Number: 19

I'm working on an IM client, and now it could work well in normal launch. But I need it to work under background I've done test like this: open a socket and connect to the IM server, and they could send/recv well. When appStop, I don't close the socket, but save the NetSocketRef to my database. The second time I launch the app, the app will read the NetSocketRef from the database and continue to send/recv from this socket. But, the problem is, when the second time launch the app, it could recieve a tcp package from the server, then the socket will be closed automaticlly. I don't know why the socket was closed. I have tested many times and to many different server, they are all the same. Even I quite the application for like 5 minutes, and then re-launch it, it could recieve the last message from the socket. Then if I try to read/recv any more, there would be an error that the socket is closed. Any suggestion? Maybe I could make a shared library, and then create a socket from the shared library. Then I guess, the system will not auto close the socket.

Nearly right!

You can (with Palm OS5.4) have a call back function for TCP/IP activity and that can be either in a shared library or your main program. You just have to make sure the module where the function is located is locked in memory. (the latter issue has been discussed in the archices)






Roger Stringer
Marietta Systems, Inc. (www.rf-tp.com)


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

Reply via email to