Max TCP Buffer size

Hello all. I apologize if this is a duplicated or I just haven’t looked hard enough. I’ve only had this for a day.
I was attempting to update the TCPCLIENT_BUF_MAX_SIZE from 128 to 1024.
It seems I was able to get half way there.
In my application.cpp, I am creating a TCPServer that I have my computer connecting to as the client. From the client, I am sending about 10kB at once. Before I changed TCPCLIENT_BUF_MAX_SIZE to 1024, I was noticing that I was receiving the data in 128 byte chunks. Now it looks like I am receiving a chunk at 1024 bytes, and then the next chuck at 128 bytes. And that just keeps repeating: 1024, 128, 1024, 128, ect…
Am I missing another place where the max buffer size needs to be increased?

You may want to read this

1 Like

Hey ScruffR.
First of all, thanks for posting the link.
I looked through it and there’s some good info.
Unfortunately, I didn’t see anything about modifying the actual receive buffer size.
I might have missed what you are trying to point out in that link though.

As the post shows there should not be any need to alter the buffer size, since the transfer does work very well with large amounts of date without any alteration but correct use of the given TCPClient class.

I haven’t found that to be the case.

The main difference between the post and what I am doing is that I am reading in bytes sent from my computer to the Photon where the Photon is the TCPServer, instead of the Photon sending to the computer. This may explain my findings.

When I increased TCPCLIENT_BUF_MAX_SIZE from 128 bytes to 1024 bytes, I noticed about a 5x increase in my throughput to the Photon.

So my question still stands if there is another place that is limiting the buffer size to 128.

It’s possible to receive data in the other direction pretty quickly as well. Clearly the Photon is optimized for sending data as it’s about an order of magnitude faster in that direction, but it does work pretty well receiving data without changing any settings.

I don’t have an actual answer to your question of whether you need to change anything other than TCPCLIENT_BUF_MAX_SIZE however.

1 Like

Thanks. That does give me a bit of peace of mind. Good info to know when characterizing the Photon’s performance.