[Mono-dev] WCF in Mono client borking negative numbers

Lukas Taves lukastaves at outlook.com
Thu Jul 4 20:53:44 UTC 2013

Sorry taking so long, I got hung up on a few things at work and couldn't implement an use case earlier.

So here's what I'm using:

My Service interface, and the callback interface:

Machine generated alternative text: [ServiceContract (SessionNode = SessionMode . Required, CalibacirContract = typeof(IServiceCallback))] public interface IService [OperationContract(IsOneWay = true)] void SubscribetoFloatO; public interface IDataServiceCallbac)c [OperationContract(IsOneWay = true)] void NewFloat(float value);

My Service implementation

Machine generated alternative text: [ServiceBehavior (InstanceContextMode = InstanceContextMode . PerSession)j internal class DataService : IDataService, IDisposable #region Fields private IServiceCailback currentCallback; #eridregion #region Inplementation of IDataService public void Subscribe() I if(this.currentCallback != null) return; this.currentCallback = OperationContext.Current.GetCallbackChannel<IDataserviceCallback>O; ) #endregion #region Implementation of IDataService public void SubscribeToFloat() I I/That requires RX, and creates a stream that sends subsequent negative numbers every second, I/but any negative integer in the in the range of [—127,—11 should do) Observable.Interval(TimeSpan.FromSeconds(Z)) .Subscribe(l => currentCallback.NewFloat(-l)): ) *endregion

And finally, my client:

​Machine generated alternative text: public class Client f tregion Fields private DataServiceClient service; tendregion tregion Constructors public Cuento f var address = new EndpointAddress(”net.tct::, r’-er’/Service”); var nettcpBinding = new NettcpBinding(SecurityMode.None); var instanceContext = new InstanceContext(new DataServiceCallback(this)); this.service = new DataServiceClient(instanceContext, nettcpBinding, address); this. service. Subscribe fl; this. service. SubscribetoFloat (); J tendregion tregion Service Callback private class ServiceCallback : IServicecallback f public void NewFloat (float value) //Here’s where the data gets J tendregion

Keep in mind that the server side code runs in default .net, while the client code is running in a Unity3D project, but to enable wcf functionality I had to manually add the following mono dlls and their versions to the project:

System.Runtime.Serialization. File Version
System.Security. File Version
System.ServiceModel. File Version

I don't know yet how to file a bug report, will try to discover how it's done asap :P

From: Rodrigo Kumpera
Sent: ‎Tuesday‎, ‎June‎ ‎25‎, ‎2013 ‎12‎:‎31‎ ‎PM
To: mono-devel-list at lists.ximian.com

Please file a bug report with a test case so we can figure out how to fix it.

On Mon, Jun 24, 2013 at 2:25 PM, LukasTaves <lukastaves at gmail.com> wrote:

I have a Unity3D client that communicates with a local service through WCF.
The service is duplex and all communication is in place and working, however
some negative numbers get borked when received.

Bellow is a list that shows subsequent received single precision numbers.
The stream was increasing 0.5 per second.


And so on... It seems that for some numbers instead of receiving the actual
negative number they get added by 255.

It's not an issue with the service itself, because connecting to the same
service using a .net client works flawlessly...

Is this a known issue with WCF in mono? Any hint on what i can do to get
around that?

Thank you!

View this message in context: http://mono.1490590.n4.nabble.com/WCF-in-Mono-client-borking-negative-numbers-tp4660022.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20130704/18572bb0/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Image915.png
Type: image/png
Size: 51382 bytes
Desc: Image915.png
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20130704/18572bb0/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Image19.png
Type: image/png
Size: 108292 bytes
Desc: Image19.png
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20130704/18572bb0/attachment-0003.png>

More information about the Mono-devel-list mailing list