Rogue Wave Server 5.1 Release Notes > Backward Compatibility > New Behavior
 
New Behavior
The behavior of the default component has changed from Rogue Wave® Server 5.0 to Rogue Wave Server 5.1.
A bug has been found in the default component of Rogue Wave Server 5.0 (and earlier versions). The default component is the component used by linked views. It can be accessed by a call to the member function IlsMvServer::GetDefaultComp.
In the previous versions of Rogue Wave Server, the default component was not created until a linked view was opened. If a distant view was opened BEFORE a linked view, the default component was wrongly assigned to the distant component. To overcome this bug in Rogue Wave Server 5.1, the default component is created while the view server is initialized, that is, while the function IlsMvServer::Initialize is executed.
As a result, the method IlsMvServer::onConnect (or your overloaded version if any), is called during the initialization phase to notify you that the default component is connecting. You will know that onConnect has been called on the default component when the function GetDefaultComp returns 0 when onConnect is called. See also IlsMvServer::CreateDefaultCompAtStartup.
Example
The following code shows how to differentiate between connecting the default component and connecting a remote component.
void MvServer::onConnect(IlsMvComponentItf& itf)
{
if (!GetDefaultComp()) {
IlsInfo() << "The Default Component is connecting" << IlsEOM;
} else {
IlsMvUser* user = itf.getUser();
IlsInfo() << "A user is connecting : " << user->userName << IlsEOM;
}
IlsMvServer::onConnect(itf);
}
Summary
As a consequence of this bug correction, you will observe a slight change in the behavior of your applications and you may have to adapt your code in your overloaded version of the function onConnect to take this new behavior into account.
*In Rogue Wave Server 5.0: The function IlsMvServer::onConnect was not called for the default component until a linked view was opened or the member function IlsMvServer::GetDefaultComp called.
*In Rogue Wave Server 5.1: The function IlsMvServer::onConnect is called systematically while the function IlsMvServer::Initialize is executed. By default, Rogue Wave Server instantiates the default component used for linked views at startup. Use the member function IlsMvServer::CreateDefaultCompAtStartup if you need to change the default behavior.

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.