-
Notifications
You must be signed in to change notification settings - Fork 201
Closed
Description
Hi,
I have a usecase where I want to read 4 bytes that define the message length that comes after it. If I read 4 bytes and then 16000 for example, I need to concat both bytestrings for my parse library, which makes a costly copy. I believe that a clean solution would be to recv the first 4 bytes with a flag MSG_PEEK and then read 16000+4 bytes again as one buffer, which would avoid the expensive append later. I noticed that flags passed to c_recv is always 0.
Could we provide an API for this? I can implement it, but I wanted to ask first about how this should be handled (portability could be an issue I believe).
Metadata
Metadata
Assignees
Labels
No labels