void
NetClientConfig::CreateConnection()
{
	NetServerInfo* s = GetSelectedServer();

	if (s) {
		NetAddr addr = s->addr;

		if (conn) {
			if (conn->GetServerAddr().IPAddr() != addr.IPAddr() ||
					conn->GetServerAddr().Port()   != addr.Port()) {
				conn->Logout();
				DropConnection();
			}
		}

		if (addr.IPAddr() && addr.Port() && !conn) {
			conn = new(__FILE__,__LINE__) NetLobbyClient; // (addr);
		}
	}

	else if (conn) {
		conn->Logout();
		DropConnection();
	}
}
Ejemplo n.º 2
0
void CBTHidConnection::TimerExpired()
    {
    // Inactivity timer has expired.
    // Drop the connection.
    DropConnection();
    // Inform the observer of the state change.
    iObserver.Disconnected(iConnID);
    }
Ejemplo n.º 3
0
nsDBusService::~nsDBusService() {
  NS_ASSERTION(!mSingleClient, "Client failed to unregister");
  DropConnection();
  if (mReconnectTimer) {
    mReconnectTimer->Cancel();
  }
  gSingleton = nsnull;
}
Ejemplo n.º 4
0
HttpConnection::~HttpConnection()
{
    close();

#ifdef _WIN32_WCE
    if (!keepalive) { 
        DropConnection();
    }
    keepalive = false;
#endif
}
bool
NetClientConfig::Logout()
{
	bool result = false;

	if (conn) {
		result = conn->Logout();
		DropConnection();
	}

	return result;
}
Ejemplo n.º 6
0
void nsDBusService::HandleDBusDisconnect() {
  DropConnection();

  nsresult rv;
  mReconnectTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);
  if (NS_FAILED(rv))
    return;
  rv = mReconnectTimer->InitWithFuncCallback(TimerCallback, this,
                                             5000, nsITimer::TYPE_REPEATING_SLACK);
  if (NS_FAILED(rv)) {
    mReconnectTimer = nsnull;
    return;
  }
}