<html><head><style data-externalstyle="true"><!--
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}

p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst, p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle, p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
--></style></head><body><div data-externalstyle="false" dir="ltr" style="font-family:Calibri, 'Segoe UI', Meiryo, 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'Khmer UI', 'Nirmala UI', Tunga, 'Lao UI', Ebrima, sans-serif;font-size:12pt;"><div>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">Sorry taking so
long, I got hung up on a few things at work and couldn't implement an use case
earlier.</p>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"> </p>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"> </p>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">So here's what I'm
using:</p><p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><br></p>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"> </p>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"> </p>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">My Service
interface, and the callback interface:</p>

<p style="margin: 0in;"><img width="640" height="181" tabindex="-1" alt="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);" src="cid:Image194.png@13fab80fae2"></p>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"> </p>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><br></p><p style="margin: 0in; font-family: Calibri; font-size: 11pt;">My Service
implementation</p>

<p style="margin: 0in;"><img width="640" height="357" tabindex="-1" alt="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" src="blob:78267DA1-76A1-48D0-92FA-0ADD3B827283"></p>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"> </p>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">And finally, my
client:</p>

<p style="margin: 0in;">​</p><p style="margin: 0in;"><img width="640" height="454" tabindex="-1" alt="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" src="cid:Image284.png@13fab80fb3c"></p>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"> </p>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"> </p>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><br></p><p style="margin: 0in; font-family: Calibri; font-size: 11pt;">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:</p>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"> </p>

<ul type="disc" style="padding-top: 0px; padding-bottom: 0px; margin-top: 0in; margin-bottom: 0in; margin-left: 0.375in; list-style-type: disc; unicode-bidi: embed; direction: ltr;">
 <li style="font-family: Calibri; font-size: 11pt; margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">System.Runtime.Serialization.
     File Version 3.0.0.0</span></li>
 <li style="font-family: Calibri; font-size: 11pt; margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">System.Security. File Version
     2.0.0.0</span></li>
 <li style="font-family: Calibri; font-size: 11pt; margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">System.ServiceModel. File
     Version 3.0.0.0</span></li>
</ul>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"> </p>

<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">I don't know yet how
to file a bug report, will try to discover how it's done asap :P</p>

​</div><div><br></div><div style="padding-top: 5px; border-top-color: rgb(229, 229, 229); border-top-width: 1px; border-top-style: solid;"><div><font face="Calibri, 'Segoe UI', Meiryo, 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'Khmer UI', 'Nirmala UI', Tunga, 'Lao UI', Ebrima, sans-serif" style='line-height: 15pt; letter-spacing: 0.02em; font-family: Calibri, "Segoe UI", Meiryo, "Microsoft YaHei UI", "Microsoft JhengHei UI", "Malgun Gothic", "Khmer UI", "Nirmala UI", Tunga, "Lao UI", Ebrima, sans-serif; font-size: 11pt;'><b>From:</b> Rodrigo Kumpera<br><b>Sent:</b> ‎Tuesday‎, ‎June‎ ‎25‎, ‎2013 ‎12‎:‎31‎ ‎PM<br><b>To:</b> mono-devel-list@lists.ximian.com</font></div></div><div><br></div><div dir="ltr">Please file a bug report with a test case so we can figure out how to fix it.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 24, 2013 at 2:25 PM, LukasTaves <span dir="ltr"><<a title="mailto:lukastaves@gmail.com" href="mailto:lukastaves@gmail.com" target="_parent">lukastaves@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">I have a Unity3D client that communicates with a local service through WCF.<br>
The service is duplex and all communication is in place and working, however<br>
some negative numbers get borked when received.<br>
<br>
Bellow is a list that shows subsequent received single precision numbers.<br>
The stream was increasing 0.5 per second.<br>
<br>
-131.5<br>
-131<br>
-130.5<br>
-130<br>
-129.5<br>
-129<br>
-128.5<br>
128<br>
-127.5<br>
129<br>
-126.5<br>
130<br>
-125.5<br>
<br>
And so on... It seems that for some numbers instead of receiving the actual<br>
negative number they get added by 255.<br>
<br>
It's not an issue with the service itself, because connecting to the same<br>
service using a .net client works flawlessly...<br>
<br>
Is this a known issue with WCF in mono? Any hint on what i can do to get<br>
around that?<br>
<br>
Thank you!<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a title="http://mono.1490590.n4.nabble.com/WCF-in-Mono-client-borking-negative-numbers-tp4660022.html" href="http://mono.1490590.n4.nabble.com/WCF-in-Mono-client-borking-negative-numbers-tp4660022.html" target="_parent">http://mono.1490590.n4.nabble.com/WCF-in-Mono-client-borking-negative-numbers-tp4660022.html</a><br>

Sent from the Mono - Dev mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Mono-devel-list mailing list<br>
<a title="mailto:Mono-devel-list@lists.ximian.com" href="mailto:Mono-devel-list@lists.ximian.com" target="_parent">Mono-devel-list@lists.ximian.com</a><br>
<a title="http://lists.ximian.com/mailman/listinfo/mono-devel-list" href="http://lists.ximian.com/mailman/listinfo/mono-devel-list" target="_parent">http://lists.ximian.com/mailman/listinfo/mono-devel-list</a><br>
</blockquote></div><br></div>
</div></body></html>