I would like to know: when programming in C using a socket (AF_UNIX) is there any limit (in bytes) when sending or receiving to or from a socket?
You can change the read and write buffers for each individual socket connection using setsockopt
(SO_SNDBUF
and SO_RCVBUF
).
The default and maximum sizes are platform dependent.
Furthermore, if you provide a larger user-side buffer for each individual read e.g. with recv
.
And if you use several recv
s in sequence, you can read an infinite amount of bytes over a connection, it'll just take infinitely long.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With