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: Daniel Kraft
Subject: Re: [libmicrohttpd] Binding to a specifc address on Windows
Date: Tue, 12 Mar 2019 07:33:33 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

Hi!

On 11.03.19 22:46, LRN wrote:
>> 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.

Ah ok, very cool!  Then I assume there's no issue at all for me.

> 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.

Ok.  I think I'm fine with just struct sockaddr for my usecase, so that
there is no need for sockaddr_un or others like that.

> 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.

Yes, building native Windows binaries is what we need in the end.

Thanks to you both!

Yours,
Daniel

-- 
https://www.domob.eu/
OpenPGP: 1142 850E 6DFF 65BA 63D6  88A8 B249 2AC4 A733 0737
Namecoin: id/domob -> https://nameid.org/?name=domob
--
3.6.0: Bar-Pri-Ran-Rog-Sam-Val-Wiz
To go: Arc-Cav-Hea-Kni-Mon-Tou

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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