I am using XSockets to send real time image data to any connected clients. Each image is fairly large(up to 1080p quality) and the video can be up to 30fps. Therefore there is a fair amount of data being shifted around. Whenever I get a new image I trigger an event and currently pass the raw byte array to the client as so
void NewImage(byte[] imgData)
{
this.InvokeToAll(imgData, "newimage");
}
My java script handler is currently empty and isn't even doing anything with the received data(I have ensure it works by printing a message etc. when a new image is received).
Without the InvokeToAll code my program runs without any issue and I have used the same code to render to Winforms before without any issue. After running this code for a few seconds it falls over due to an out of memory exception. Is there something I am missing here, the imgData is nulled from where it is sent(after sending it to the clients) and the code works outside of XSockets without any issues.