Bug 2554

Summary: Mono cannot serialize IPEndPoint objects in WCF duplex communication callbacks.
Product: [Mono] Class Libraries Reporter: Cetin Sert <cetin.sert>
Component: WCF assembliesAssignee: Bugzilla <bugzilla>
Status: NEW ---    
Severity: normal CC: mono-bugs+mono
Priority: ---    
Version: 2.10.x   
Target Milestone: Untriaged   
Hardware: PC   
OS: All   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: error log from my application

Description Cetin Sert 2011-12-16 23:56:03 UTC
Created attachment 1066 [details]
error log from my application

A distributed reverse proxy application I am developing ([PortFusion](http://portfusion.sourceforge.net)) has the following network API:

    namespace API
        public interface IConnectionHostCallback
            [OperationContract(IsOneWay = true)]    void Relay              (int serverPort, IPEndPoint client, byte[] message);
            [OperationContract(IsOneWay = true)]    void DisconnectAtClient (int serverPort, IPEndPoint client);

        [ServiceContract(CallbackContract = typeof(IConnectionHostCallback), SessionMode = SessionMode.Required)]
        public interface IConnectionHost
            [OperationContract]                     bool OpenTunnel         (int serverPort);
            [OperationContract]                     bool CloseTunnel        (int serverPort);
            [OperationContract]                     int  Reply              (int serverPort, IPEndPoint client, byte[] reply);
            [OperationContract]                     bool DisconnectAtHost   (int serverPort, IPEndPoint client);

When I run the client application with Mono and it receives from host a *callback* **Relay(int, IPEndPoint, byte[])**, the **IPEndPoint** object is always uninitialized. (The client can send IPEndPoints to host without any problem.)

As this issue is mono-only and the network API has proven quite stable otherwise, I would like to know whether there is a workaround for this.

My questions:

 1. Has anyone had the same or a similar serialization issue with Mono WCF and solved it?
 2. Does anyone know how I could implement a mono-only serialization logic for WCF to use without changing the API otherwise?

Any suggestions, hints, links to reading material are also most welcome.

Info on my client-side app.: .NET 4.0 / C#, WCF configuration is handled purely in code, no svcutil generated classes are used (with or without svcutil mono behaves the same), tested with Mono 2.10.6.
Comment 1 Cetin Sert 2011-12-17 00:05:04 UTC
The application uses NetTcpBinding.