Firoso
Firoso

Reputation: 6685

Simple remote process object interaction in C#

I'm sure there has to be an easy way to do this, maybe I'm making more work for myself than I need to. I'm trying to set up cross system communications in a way that I can have bi-directional communication between objects, I imagine it would be something like this.

public interface ISharedResource

public class SharedResourceHost : ISharedResource  //<- slave process

SharedResourceHost resource = new SharedResourceHost("http://192.168.1.102/HostedResources/Process1");

resource.Invoke("SomeMethod");

is there anything like this? I don't wanna have to pull teeth setting up web services etc but if I have to I will.

Upvotes: 0

Views: 856

Answers (3)

Alexander Kahoun
Alexander Kahoun

Reputation: 2488

It looks like you'd want either Remoting or WCF. However in both instances you're going to need to make sure you have the correct ports open. I don't see how setting up Web Services would be difficult, but I can only go off of your post.

Upvotes: 0

Joel Coehoorn
Joel Coehoorn

Reputation: 415745

You're definitely re-inventing the wheel here. Look at the System.Runtime.Remoting namespace. I'd link in a tutorial, but I'd just have to check Google and you can evaluate what will make more sense for you better than I.

Upvotes: 2

Leahn Novash
Leahn Novash

Reputation: 2941

You should check WCF. It is far too big to explain here but this article should give you some pointers.

http://msdn.microsoft.com/pt-br/library/bb907581.aspx

WCF allows you to set up interfaces in which two objects can communicate using a protocol of your choice.

Upvotes: 3

Related Questions