|
Socket problem with Moment Statistics Jack SO from Hong Kong [8 posts] |
17 year
|
Dear STeven
I tried connecting the socket with C#. But the socket connection keeps connect and disconnect when I added Moment Statistics in the pipeline. If I remove the moment statistics, it turns back normal and work well. It doesn't happen on geometric statistics.
Thanx for your help.
|
|
|
Anonymous |
17 year
|
Jack,
That was a problem with our friend the COG_X. It converts it to an int ... the Moment Statistics calculates and sends it over as a decimal string. So you were getting a type cast error that in your C# program that was not printing anything out. Perhaps you should enable/uncomment the console.writeline in the catch area.
To have it work change the line from
int myValue = Convert.ToInt32(Encoding.ASCII.GetString(data, 0, len));
to
int myValue = (int)Convert.ToDecimal(Encoding.ASCII.GetString(data, 0, len));
and things should work better.
STeven.
|
|
|
Re : Jack SO from Hong Kong [8 posts] |
17 year
|
Dear STeven
It seems that it is not related to C# programming code because the situation (keeps connect and disconnect) still happens, even I haven't added any code to catch the variables.
Thanx for your prompt reply again :o)
|
|
|
Anonymous |
17 year
|
Jack,
Can you try downloading the Extensions again at
http://www.roborealm.com/downloads/Extensions.zip
and try that Extension.cs?? (Careful to copy your current Extension.cs to a safe place!) We WERE able to replicate your issue with the old version but everything seems fine with the new fixed one. Based on your last report it does appears that the COG_X was causing the issue.
If not try stepping though your Extension.cs and see where things may be going wrong. Note that you can run the Extension.cs within Visual C# Expression while operating with RoboRealm. Also just to be sure there are no fixes that I was unaware of and that you are testing the same version we have try download RoboRealm again and unzip over your current install.
Thanks,
STeven.
|
|
|
Thanx a lot Jack SO from Hong Kong [8 posts] |
17 year
|
thanx a lot, it works perfectly :)
|
|