Created
April 22, 2016 21:39
-
-
Save jbw/fe2b0a766ef4cf5b867818e249a79020 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DotNetRemotingExample; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.Remoting; | |
using System.Runtime.Remoting.Channels; | |
using System.Runtime.Remoting.Channels.Tcp; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace DotNetRemotingClient | |
{ | |
/// <summary> | |
/// Clients | |
/// </summary> | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
ChannelServices.RegisterChannel(new TcpClientChannel(), false); | |
RemotableType remoteType = (RemotableType)Activator.GetObject(typeof(RemotableType), "tcp://localhost:9932/RemotableType"); | |
if (remoteType == null) | |
{ | |
Console.WriteLine("Unable to get remote referance"); | |
} | |
else | |
{ | |
var response = remoteType.Connect(); | |
Console.WriteLine(response); | |
var testObj = remoteType.GetNewTestObject(); | |
Console.WriteLine("Id:" + testObj.Id); | |
} | |
Console.ReadLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment