G
Guest
First, my question: Should I use Write or BeginWrite (sync or async) to
stream data to my clients.
Details:
On the server I have a custom circular data buffer that receives byte array
data representing data structures at a rate of 30ms.
On a thread seperate from that which Enqueues data to the buffer I have a
high performance timer that Dequeues data from the custom buffer and sends it
via a tcpClient connection to the client. The Dequeue timer runs at a rate
greater than or equal to the Enqueue rate so the buffer never fills up.
On the Client I have a similar custom data buffer that will buffer the data
it receives from the server until it can be displayed.
My data needs to be displayed in the order it was originally created. The
byte array sturctures are < 400 bytes each.
I have googled the internet for hours but I am still not sure if I should be
sending my data to the client using Write or BeginWrite/EndWrite. I know
that with Write I am gauranteed the proper order, which is good, but will
Write be able to keep up performance wise? Or should I use
BeginWrite/EndWrite, then have logic on the client to make sure things are in
the correct order.
Any insight into this is very appreciated!
stream data to my clients.
Details:
On the server I have a custom circular data buffer that receives byte array
data representing data structures at a rate of 30ms.
On a thread seperate from that which Enqueues data to the buffer I have a
high performance timer that Dequeues data from the custom buffer and sends it
via a tcpClient connection to the client. The Dequeue timer runs at a rate
greater than or equal to the Enqueue rate so the buffer never fills up.
On the Client I have a similar custom data buffer that will buffer the data
it receives from the server until it can be displayed.
My data needs to be displayed in the order it was originally created. The
byte array sturctures are < 400 bytes each.
I have googled the internet for hours but I am still not sure if I should be
sending my data to the client using Write or BeginWrite/EndWrite. I know
that with Write I am gauranteed the proper order, which is good, but will
Write be able to keep up performance wise? Or should I use
BeginWrite/EndWrite, then have logic on the client to make sure things are in
the correct order.
Any insight into this is very appreciated!