Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide recv_msg and send_msg #109

Open
Chris00 opened this issue Aug 2, 2016 · 6 comments
Open

Provide recv_msg and send_msg #109

Chris00 opened this issue Aug 2, 2016 · 6 comments

Comments

@Chris00
Copy link

Chris00 commented Aug 2, 2016

Lwt_bytes provides recv_msg and send_msg that take a list of Cstruct.t—called io_vector there. I think that these calls should also be provided by ocaml-cstruct.

@cfcs
Copy link

cfcs commented Jan 20, 2018

I think this should be out of scope of Cstruct. Your libc bindings (on Unix, where send_msg and recv_msg are useful) should be able to work on bigarrays, in which case you can access the underlying buffer directly.

EDIT: In any case the recv_msg and send_msg are a bit crap since they do not handle writes/receives of more than 2GB, unlike the Linux sendmsg/recvmsg syscalls which return a ssize_t, ie a signed long (on 64-bit platforms that's a signed 64-bit integer).

@avsm
Copy link
Member

avsm commented Jan 23, 2018

It is still useful to provide the Cstruct equivalents of Lwt calls, just to avoid the possible conversion errors from dealing with offsets and so on.

@hcarty
Copy link

hcarty commented Jan 23, 2018

It could live in a separate lwt-cstruct library or sublibrary within cstruct. It would be nice in general to have cstruct IO available in Let.

@avsm
Copy link
Member

avsm commented Jan 23, 2018

There already is an Lwt_cstruct sublibrary :-)

@hcarty
Copy link

hcarty commented Jan 23, 2018

I should read more carefully before commenting! Sorry for the noise!

@avsm
Copy link
Member

avsm commented Jan 23, 2018

Not at all; thanks for paying attention to the repository at all :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants