void SslTcpClient::OnNetConnecting()
{
	if(GetConnectStatus() != kConnecting)
	{
		//fStatus = kConnecting;
		SetConnectStatus(kConnecting);
		SetTimeout(kTimeReconnect*1000);
	}
}
void SslTcpClient::Offline()
{
	//fStatus = kOffline;
	SetConnectStatus(kOffline);
	SetTimeout(0);

	//Clear msg in list.
	OSMutexLocker locker(&fMutexList);
	
//	ListEmpty(&fMsgList);
}
void SslTcpClient::OnTimeout()
{
	OSMutexLocker locker(&fMutexList);
	SetTimeout(kTimeKeepAlive*1000);
	SetConnectStatus(kOffline);
	if(fTcpSocket != NULL)
	{
		delete fTcpSocket;
	}
	fTcpSocket = new SslTcpClientSocket(Socket::kNonBlockingSocketType);
	SetClientSocket(fTcpSocket);
}
BOOL CPropPageRestore::OnInitDialog() 
{
	CPMPropPage::OnInitDialog();
	
    SetSourceMode();
    
    OnCommSettingsChanged();

    SetConnectStatus(FALSE);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
/*****************************************************************************
 * So we connect our Relay IP here.                                          *
 *****************************************************************************/
eNextState mx_connect_ip(AsyncIO *IO)
{
	SmtpOutMsg *Msg = IO->Data;
	SetSMTPState(IO, eSTMPconnecting);

	EVS_syslog(LOG_DEBUG, "%s(%s)\n", __FUNCTION__, (Msg->IsRelay)? "Relay":"Remote");

	IO->ConnectMe = Msg->pCurrRelay;
	Msg->State = eConnectMX;

	SetConnectStatus(IO);

	return EvConnectSock(IO,
			     SMTP_C_ConnTimeout,
			     SMTP_C_ReadTimeouts[0],
			     1);
}
void SslTcpClient::Online()
{
	//fStatus = kOnline;
	SetConnectStatus(kOnline);
	SetTimeout(kTimeKeepAlive*1000);
}