libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] Binding to a specifc address on Windows


From: LRN
Subject: Re: [libmicrohttpd] Binding to a specifc address on Windows
Date: Tue, 12 Mar 2019 00:46:58 +0300
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3

> 05.03.2019, 17:21, "Daniel Kraft" wrote:
>>
>> However, the option expects the binding address as "struct sockaddr",
>> which as far as I can tell is POSIX and not standard C.

It's not. Look in /mingw/include/psdk_inc/_ip_types.h (which is included by
winsock2.h), it's there. And many socket API functions do take struct sockaddr.

The thing you *should* look out for is sockaddr_un, which is used by AF_UNIX
sockets, which *aren't* supported on Windows.

struct sockaddr is just the most abstract of the sockaddr types, with just one
meaningful field (family). The rest is just an array of bytes. Usually you cast
it to a particular type (based on the value of the family field), such as
struct sockaddr_in or struct sockaddr_in6.

Or maybe you're confusing struct sockaddr and SOCKADDR (which is what WSA tends
to use). Don't worry, usually they are one and the same.

On 11.03.2019 23:17, Evgeny Grin wrote:
> Please clarify, whether do you want to use MHD on Windows natively or with 
> MSys
> POSIX transformation layer?
> It is two different tasks.
Most likely the former. MSYS2 developers do make some effort to make it clear
that MSYS shell is for MSYS developers.

P.S. Your email client misquotes the messages. In the original message the OPs
signature (https://www.domob.eu/) started with the appropriate "-- " (note the
trailing space), just as your own currently is. But in your reply your email
client included the signature into the quotation (which is bad), and also
stripped the trailing space (which is also bad). Also, my own Thunderbird
didn't strip your signature right now, while i'm writing this reply, so maybe
it's just HTML emails that are broken (your reply is pure-HTML, without a
text-only version), so it's less about misquoting and more about not using HTML.


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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