c# - Wcf duplex communication with named pipe -
we moving .net remoting wcf. using ipc before(because have performances consideration) when possible.
i tried replicate first "service" having on .net remoting wcf.
before having events on server have forwarded client. client giving proxy inform of such event.
in wcf, understanding have use duplex communication, specified callbackcontract on servicecontract.
but when i'm trying use it, such kind of errors:
contract requires duplex, binding 'netnamedpipebinding' doesn't support or isn't configured support it.
did wrong? or cannot have 2 way communication(other query-response)? cannot believe possible in .net remoting not in wcf?
edit
here configurations
server side:
uri uri = new uri("net.pipe://localhost/my/service"); servicehost servicehost = new servicehost(typeof(myservice),uri); netnamedpipebinding binding = new netnamedpipebinding(netnamedpipesecuritymode.none); binding.transfermode= transfermode.streamed; binding.security.transport.protectionlevel = protectionlevel.none; binding.maxbufferpoolsize = int64.maxvalue; binding.maxbuffersize=int32.maxvalue; binding.maxreceivedmessagesize=int64.maxvalue; serviceendpoint serviceendpoint = new serviceendpoint(contractdescription.getcontract(typeof(imyservice)), binding, uri); serviceendpoint.endpointbehaviors.add(new protoendpointbehavior()); servicehost.addserviceendpoint(serviceendpoint); client side:
uri uri = new uri("net.pipe://localhost/my/service"); endpointaddress address = new endpointaddress(uri); instancecontext context = new instancecontext(callback); m_channelfactory = new duplexchannelfactory<imyservice>(context, binding, endpoint); m_channelfactory.endpoint.endpointbehaviors.add(new protoendpointbehavior()); m_channelfactory.faulted += onchannelfactoryfaulted; m_innerchannel = m_channelfactory.createchannel(); the service declaration:
[servicecontract(sessionmode = sessionmode.required, callbackcontract = typeof(imyservicecallback))] //note tried without sessionmode specified public interface imyservice: iservice{...} the service implementation:
[servicebehavior(instancecontextmode = instancecontextmode.persession)] public class myservice: imyservice, idisposable{...}
Comments
Post a Comment