libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] Websockets


From: Christian Grothoff
Subject: Re: [libmicrohttpd] Websockets
Date: Tue, 14 Mar 2017 02:51:11 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]