Game Development Reference
In-Depth Information
PigLatinController controller = Activator.GetObject(typeof(PigLatinController),
“tcp://localhost:9978/PigLatinController”)
as PigLatinController;
Note
In order to use the Remoting functionality present in the .NET framework, you must reference the
System.Runtime.Remoting.dll assembly.
Now we can use our public method ConvertToPigLatin() and see Remoting in action.
string result = controller.ConvertToPigLatin(“Remoting Rocks”);
When this line is executed, the result is Emotingray Ocksray .
Remoting is an excellent choice for managed inter-process communication over a
network between multiple machines, but it is overkill for many projects. This sec-
tion briefly skimmed the surface of .NET Remoting, so it is recommended that
you read up on additional information if you plan on using Remoting extensively
in your applications.
Clipboard
The Clipboard mechanism is a collection of functions and messages that allow for
the transfer of data between multiple applications or within a single application.
Since all applications have access to the Clipboard, it can also serve as an IPC
mechanism. Its usage is a special case though, and is generally used as a storage
system for a user to manually move data in memory between multiple applica-
tions. Using the Clipboard mechanism is covered in a separate chapter of this topic.
TCP\IP Loopback Communication
Another common method of inter-process communication is though the use of
TCP\IP communication to pass data between processes. This approach can be
used to communicate between different machines, or the loopback address
(127.0.0.1) can be used to communicate with endpoints on the same machine.
While this approach has its uses, it may not be the best way if you are doing a large
number of chatty calls, or if you do not want to manage designated port numbers
for your applications. This approach is natively supported in Microsoft.NET, so it
may be useful to you if performance isn't critical and you just want an easy way to
pass data between processes on the same machine or across a network.
 
Search Nedrilad ::




Custom Search