Would anyone know where to start troubleshooting this? I'm sending many single-precision floating point numbers over a socket connection, and every once in a great while a number will come by that appears to take up 5 bytes. Of course all the normal ones take up 4 bytes. The reason this appears to me to be the problem is because I found a few of these troublemaking numbers and tested sending them by themselves. 5 bytes appeared in the receiving buffer while any other number only caused 4 bytes to appear.
In the receiving code I assume a float is 4 bytes, and when I get 5, every number after that weird one is incorrect. So even if it were an extremely rare problem, since I am sending so much information it causes devastating trouble each time.
Anyways, my question is where should I start looking for the problem? Is it likely to be at the receiving end or is it with my TCL code...
and three other numbers that don't work: 0.134918, -0.134903, 0.0879
-Bones
In the receiving code I assume a float is 4 bytes, and when I get 5, every number after that weird one is incorrect. So even if it were an extremely rare problem, since I am sending so much information it causes devastating trouble each time.
Anyways, my question is where should I start looking for the problem? Is it likely to be at the receiving end or is it with my TCL code...
Code:
fconfigure $clientSocket -buffering none
fconfigure $clientSocket -buffersize 10
fconfigure $clientSocket -encoding binary
....
set testStr {-0.0879111}
set binstr [binary format f* $testStr]
puts -nonewline $clientSocket $binstr
and three other numbers that don't work: 0.134918, -0.134903, 0.0879
-Bones