Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

In order to close a pop 3 sesion I have to send the "Quit" message.
If the user press the END key i cannot send anything to the server because my PPP connection is in status "NET_PPP_CLOSING" and i cannot write anymore to a socket.

look at this code please:
case EVT_APP_STOP:

stNetState=INETMGR_NetStatus (m_pINetMgr,&pNetStats);
//stNetState=NET_PPP_CLOSING
if (!m_safeQuit &&m_pISocket) {
if (!SendQuitData()) {
*((boolean*) lParam) = FALSE;
//I PUT my applet in background, hoping i will be able to send "quit" later
}

return TRUE;

.....

SendQuitData() tries to send the QUIT\r\n message to a pop3 server, but after a while it fails because the PPP connection closed.

This code works perfect on the emulator.
It seems to me to be a problem because when user hits the quit button the BREW API kills the PPP connection.

What can i do?
THANKS in advance