Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Server code</strong></p> <p>Create a new channel listening communicating on <a href="http://compnetworking.about.com/od/networkprotocols/f/port-numbers.htm" rel="nofollow noreferrer">port</a> 8085 </p> <pre><code>TcpChannel channel = new TcpChannel(8085); </code></pre> <p>Register with remoting channel services.</p> <pre><code>ChannelServices.RegisterChannel(channel); </code></pre> <p>Tell remoting that we are using a service of type RemoteObject and it should be created once.</p> <pre><code>RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemoteObject), "myobject", WellKnownObjectMode.Singleton); </code></pre> <p>Readline is simply used to wait for enter (before exiting console application).</p> <p>Console.ReadLine();</p> <p><strong>Client code</strong></p> <p>Same as server side </p> <pre><code>TcpChannel channel = new TcpChannel(); ChannelServices.RegisterChannel(channel); </code></pre> <p>Create a remoting proxy proxy which communicates with server at localhost on port 8085 and used RemoteObject</p> <pre><code>RemoteObject remoteObject = (RemoteObject)Activator.GetObject(typeof(RemoteObject), "tcp://localhost:8085/myobject"); </code></pre> <p>Send a message to server</p> <pre><code>remoteObject.PrintMessage("Hello world!"); </code></pre> <p><strong>Final words</strong></p> <p>You can add more methods to the RemoteObject class to build a complete chat application.</p> <p>Also read about <a href="http://www.codeproject.com/KB/IP/remotingcallbacks.aspx" rel="nofollow noreferrer">remoting callbacks</a>. Your professor is a bit out of date. Remoting have been replaced by WCF by microsoft.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload