MrLlama
5 years agoChannel Surfer
roStreamSocket documentation example has a bug
The roStreamSocket "echo server" example contains a bug. Specifically, when the socket IDs happen to be over 8 digits long, the `Str(socket_id)` representation loses precision because it uses scientific notation. Given that subsequent connections usually have similar socket IDs, this can lead to different connections having the same stringified representation:
Brightscript Debugger> ? connection.GetID() 87031812 Brightscript Debugger> ? Str(connection.GetID()) 8.703181e+07 Brightscript Debugger> ? connection.GetID().ToStr() 87031812
Note that in the above example, the Str() result is missing the final "2" digit.