0

Does the NetNamedPipeBinding (WCF) is supported in the new versions of Unity? If yes, can you please provide an example?

I was able to implement this example using the NetNamedPipeBinding in Visual Studio 15 (both the Client and the Server sides), however, implementing the Client side in Unity causes the following error:

InvalidOperationException: Channel type IDuplexSessionChannel is not supported.

I did manage to implement this example for the BasicHttpBinding (Client side) in Unity.

Any suggestions?

EDIT:

I get the exception in the following line:

RemoteAPIClient client = new RemoteAPIClient(new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/netPipe"));     
try
{
    client.Ping();
}

Unity version: 2017.2.0f3 (64-bit) The System.ServiceModel DLL i placed in Unity i took from here:

C:\Program Files\Unity\Editor\Data\Mono\lib\mono\2.0

Thank you!

Max Zemsky
  • 162
  • 1
  • 2
  • 15
  • 1
    Try it yourself. There are many examples online. Find one then try it and see if it works. If it doesn't work, post it in your question and ask why it's not working. – Programmer May 17 '18 at 11:16
  • @Programmer Thank you for your input. I have updated the question. – Max Zemsky May 17 '18 at 11:43
  • 1
    You need to add more details: 1.mention which line of code is causing that error. 2. Your Unity version. 3. Where you got the dll that let's you use `System.ServiceModel;`. – Programmer May 17 '18 at 13:28
  • @Programmer Done. – Max Zemsky May 17 '18 at 13:42
  • 1
    Good. The example code you posted with `RemoteAPIClient` is not even on the tutorial [link](https://weblogs.asp.net/ralfw/a-truely-simple-example-to-get-started-with-wcf) you provided. The client code from that page didn't use `RemoteAPIClient`. If you are following a tutorial or example, copy it as it is and make sure it works before changing it around. – Programmer May 17 '18 at 13:46
  • @Programmer Thank you for your support! Yes, i have tried this as well. If we are discussing the example in the link so i get the same exception in the scf.CreateChannel(); line. – Max Zemsky May 17 '18 at 13:54
  • 1
    Ok. I will put an answer. Just making sure you're not using another API and getting this error. – Programmer May 17 '18 at 13:55
  • 1
    Wait a minute.... `CreateChannel()` cannot cause that error but `CreateChannel( Binding binding, EndpointAddress endpointAddress)` can. The tutorial link you provided uses `CreateChannel()` but I believe you are using `CreateChannel( Binding binding, EndpointAddress endpointAddress)`. At this moment without your actual server and client code, it's impossible to point out your problem. The code in your question is unrelated to your problem. – Programmer May 17 '18 at 14:40
  • @Programmer On my client side i have the following: string address = "net.pipe://localhost/netPipe"; NetNamedPipeBinding binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None); ChannelFactory scf = new ChannelFactory(binding, address); IService s = scf.CreateChannel(); s.Ping("Max"); – Max Zemsky May 17 '18 at 14:51
  • @Programmer On my server side i have the following: string address = "net.pipe://localhost/netPipe"; ServiceHost svh = new ServiceHost(typeof(ServiceImplementation)); NetNamedPipeBinding binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None); svh.AddServiceEndpoint(typeof(Communication.IService), binding, address); svh.Open(); – Max Zemsky May 17 '18 at 14:55

0 Answers0