[Backalaika-developers] I have studied remoting a little now.
Status: Beta
Brought to you by:
nandof
From: Nando F. <nan...@ma...> - 2004-09-25 22:33:48
|
Dear Backalaikers, PLEASE NOTICE ============= I have renamed my BackalaikaProfile class to ProfileSingle... as opposed to my ProfilesList class. Proposals to Fabio ================== - Rename the ServerFile class to DiskFile? (The class has been moved to its own file.) Proposals to everyone ===================== - Due to .NET limitations for writing Windows services, perhaps we should permanently think of BackupServer and FileServer hosts as Windows.Forms apps, whose icons stay in the System Tray. They should have means of minimally editing their configuration (port number etc.) so they can be reached through the LAN. If we programmatically configure remoting, there will be no need for default .NET configuration files, which will be replaced by OUR configuration files. Remoting programmatically is very different from remoting with configuration files. I tried configuration files for a while and hated it. I prefer C# code to XML because once you load the XML file there is no way of knowing what the hell is happening and exactly why things don't turn out the way you expected them... I've got a working little demo of programmatic remoting (more or less like Fabio's previous demo). It is temporarily on the CVS server. As the program stands now, first the server outputs: Starting server... Using TCP channel 7777 set StringField = Nando rules Server ready, waiting for clients. get StringField = Nando rules The client should receive: Nando rules Hit ENTER to exit... Then you start the client, and the client outputs: Starting client... Using TCP channel 1234 Getting object from tcp://localhost:7777/MyUri Client ready The server says: MyRemoteClass initialized without any parameters passed. Hit ENTER to exit... By now, if you look back at the server, there are two new lines: set StringField = MyRemoteClass initialized without any parameters passed. get StringField = MyRemoteClass initialized without any parameters passed. This means the server was accessed, but it created a new object instead of sending the first object. Even though it is working, this is the one annoying thing. The remote object is instantiated when the client accesses the server. It would be useful if the server could create the object and populate it and the client would get THAT object instead of a new one... I wonder if this is by design or if there is a way to do what I want. Because I intend to use this with the ProfilesList class, which stays on Backup Server but can be accessed from an AdminGUI anywhere, this is a singleton object! From what I read, it is created once, then it is always the same object for all clients that access it. So it would make sense to have the SERVER create the object. Now there's a real challenge. I know it would be easier to work around this, but challenges are challenging :))) Nando |