I have a written an event driven server (request response protocol - HTTP like) using non blocking sockets. I tested partial reads by writing a client that sends the request in discrete chunks after every few seconds. How do I test partial writes i.e. I need to write 100 bytes and then send call returns with only 10 bytes written.
I am writing perl based clients. This is over SSL but for the purposes of this question, I am ok with partial writes on TCP.
Try to reduce the size of the output buffer:
err = setsockopt(fd, SOL_SOCKET, SO_SNDBUF, 1)
This should make send output only part of the buffer.
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