c# - WCF NamedPipe CommunicationException - "The pipe has been ended. (109, 0x6d)." -


i writing windows service accompanying "status tool." service hosts wcf named pipe endpoint inter-process communication. through named pipe, status tool can periodically query service latest "status."

enter image description here

on development machine, have multiple ip addresses; 1 of them "local" network 192.168.1.xx address. other "corporate" network, 10.0.x.xx address. windows service collects udp multicast traffic on single ip address.

the windows service has, until now, worked fine long uses "192.168.1.xx," address. consistently reports status correctly client.

as switched other, "corporate" ip address (10.0.x.xx) , restarted service, continuous "communicationexceptions" when retrieving status:

"there error reading pipe: pipe has been ended. (109, 0x6d)." 

now, wouldn't think udp client's 'claimed' ip address should have functionality of named-pipe interface; separate pieces of application!

here relevant wcf config sections:

//on client app: string mynamedpipe = "net.pipe://127.0.0.1/mynamedpipe"; channelfactory<imyservice> proxyfactory =     new channelfactory<imyservice>(         new netnamedpipebinding(),         new endpointaddress(mynamedpipe));   //on windows service: string mynamedpipe = "net.pipe://127.0.0.1/mynamedpipe"; myservice = new myservice(mycustomargs); servicecontracthost = new servicehost(myservice ); servicecontracthost.addserviceendpoint(     typeof(imyservice),     new netnamedpipebinding(),     mynamedpipe);  servicecontracthost.open(); 

i wouldn't think 'permissions' issue - i'm running client administrative privileges - perhaps there's domain-specific reason broke?

the ip address was, turns out, complete red herring.

the real reason exception invalid enum values being returned wcf service.

my enum defined thusly:

[datacontract] public enum myenumvalues : byte {     [enummember]     enum1 = 0x10,     [enummember]     enum2 = 0x20,     [enummember]     enum3 = 0x30,     [enummember]     enum4 = 0x40, }  

it looks fine on surface.

but raw status reported underlying service byte value of "0," , there no corresponding enum value cast it.

once ensured enum values valid, tool lit christmas tree.

when in doubt, assume wcf data invalid.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -