private void UpdateServerExternalAddress()
{
//
// Queue a work item to the thread pool for determining the server
// external address, and then set up for another continuation.
//
// Later on, the command dispatch loop will notice that a new
// external hostname has been set, and will update the database as
// appropriate.
//
ThreadPool.QueueUserWorkItem(delegate(object state)
{
try
{
string Hostname = ALFA.WebServices.GetExternalHostname(WorldManager.Configuration.GetHostnameUrl);
lock (ExternalHostnameLock)
{
ExternalHostname = Hostname;
}
}
catch (Exception e)
{
WriteTimestampedLogEntry(String.Format("ACR_ServerCommunicator.UpdateServerExternalAddress(): Encountered exception: {0}", e));
}
});
DelayCommand(UPDATE_SERVER_EXTERNAL_ADDRESS_INTERVAL, delegate()
{
UpdateServerExternalAddress();
});
}