07-25-2019 03:24 AM
Hi Forest,
it will be ok as long as your server reads the shared variable fast enough, before the 2nd client overwrites values from 1st client. After all this still allows race conditions…
That's why we also suggested to implement your own server-client handling using other techniques like TCP/UDP communication or network streams. Have your server create a separate communication channel to each client, so you can avoid the race condition above!
(Nobody said it would be super-easy.)
07-25-2019 06:06 AM
@GerdW wrote:
...using other techniques like TCP/UDP communication or network streams.
Thank you for your advice. I am going to use UDP connection. And every client will have diferent local port and transmeet data like: "{Index,value}" to the same server port. And server will form the array with all parameters.
What is better network streams or UDP?
And can I use security options if the machines will in domain? Like user-password.
07-25-2019 07:28 AM
Hi Forest,
I am going to use UDP connection. And every client will have diferent local port
When you use UDP, then each client can use the same port and send its data to just one port on the server. Your server will "queue" the received UDP messages in its network buffers…
What is better network streams or UDP?
Both have their advantages and disadvantages.
Choose for yourself!
And can I use security options if the machines will in domain? Like user-password.
Sure. You just need to program your "security options"…
09-06-2019 08:16 AM
@GerdW wrote:
Your server will "queue" the received UDP messages in its network buffers…
Is this bad? And can I affect or choose size of this buffer?