@Manuel, Dein Tipp - WebService.
Sieht in der Tat einfach aus.
Kleines Verständnisproblem
Pipe
Localhost und IService stellen die Verbindung her.
helloservice könnte anders heißen?
Wie sendet jetzt aber der Client zum Server?
Und umgekehrt?
Über den Funktionsaufruf HelloWorld?
Würde so was von C# auf QT gehen?
Ich könnte ja eine Pipe für das Lesen, für das Schreiben erstellen.
"helloserviceWRITE"
"helloservice"READ"
Vielleicht kannst noch was sagen. Danke im Voraus.
Grüße Ulrich
[ServiceContract]
public interface IService
{
[OperationContract]
void HelloWorld();
}
public class Service : IService
{
public void HelloWorld()
{
//Hello World
}
}
// CLIENT
public class ServiceProxy : ClientBase<IService>
{
public ServiceProxy()
: base(new ServiceEndpoint(ContractDescription.GetContract(typeof(IService)),
new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/helloservice")))
{
}
public void InvokeHelloWorld()
{
Channel.HelloWorld();
}
}
// SERVER
var serviceHost = new ServiceHost
(typeof(Service), new Uri[] { new Uri("net.pipe://localhost/") });
serviceHost.AddServiceEndpoint(typeof(IService), new NetNamedPipeBinding(), "helloservice");
serviceHost.Open();
Console.WriteLine("Service started. Available in following endpoints");
foreach (var serviceEndpoint in serviceHost.Description.Endpoints)
{
Console.WriteLine(serviceEndpoint.ListenUri.AbsoluteUri);
}