On 03/13/2017 09:39 PM, John Duncan wrote: > Quick question. I noticed when I built the library, it didn't move > mhd_sockets.h into the includes. That file contains all the > MHD_send_/MHD_recv_ macros used in the websockets unit test. Am I supposed > to re-implement the functions/macros found in there, or am I supposed to > include that code with my project? I know I could just snip out the code > and use it, but for forward compatibility I'd like to know, from the devs, > how I should proceed for the least number of future-headaches.
Those are just convenience wrappers for us around send()/recv(). You are not expected to use those at all in your own code. The upgrade method gives you a socket and applications can expect to be able to use the usual system calls (read/write/send/recv, etc.) directly with the (web)socket. Just be aware that you might have been given a socketpair() in case there's actually HTTPS underneath. Thus, stuff like ioctl() and setsockopt() may not work correctly. If anyone needs support there, this would have to be added to MHD: This is what MHD_upgrade_action() is supposed to be used for in the future, in addition to the current close()-logic. Happy hacking! Christian
signature.asc
Description: OpenPGP digital signature