<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">> You need to elaborate a little more. “is not standardised across platforms at all”. In my eyes the reverse is true, the socket API *is* standardised by Posix and even Winsock2 is virtually identical to the Unix one (being just a Windows port of the BSD one).
> Yes there are a lot of small differences and various extensions, but nothing fundamental unless you want to get really advanced.</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">The sockaddr part is definitely not standardized, and that is what I really mean since sockaddr is almost unavoidable when using socket. If sockaddr is not standardized, socket is not standardized. I apologize for not making myself clear. </pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">> Differences in size and alignment are completely handled by the clang C mapping and of no concern at all to the user of those structs?</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">Not when in when BSD has 104 bytes in sockaddr_un.sun_path and Linux has 104. Plus BSD has extra sa_len component.</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">> Absolutely, the raw structs are hard to use as-is. But since you can extend C structs in Swift you can make them really nice.
</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">I agree with you, that’s why we should include in the api. </pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">This is my implementation (sockaddr family as enums) btw: <a href="https://github.com/projectSX0/spartanX/blob/master/Sources/SXSocketAddress.swift" class="">https://github.com/projectSX0/spartanX/blob/master/Sources/SXSocketAddress.swift</a>.</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""><pre style="white-space: pre-wrap;" class="">> Yes, agreed. There should be protocols for such stuff. What is your opinion on my point:
> ><i class=""> 3) Do you really want just a Socket, or is what you really want
</i>> ><i class=""> a (byte) stream framework?</i></pre><pre style="white-space: pre-wrap;" class="">I’ll say I think just socket, my overall approach is, make an independent layer for socket.</pre><pre style="white-space: pre-wrap;" class="">Then after all if we decide to build default stream framework/event looping as well, we can simply build it separately and make socket compatible with it. </pre><pre style="white-space: pre-wrap;" class="">If we going to need socket anyway, why don’t we open up more opportunities for developers as well?</pre><pre style="white-space: pre-wrap;" class=""> </pre><pre style="white-space: pre-wrap;" class="">Off topic: Can you cc me a copy as well when you reply? Since somehow I can only see your response and reply manually from Archive, and I’d like to discuss with you more.</pre></pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""><br class=""></pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">Sincerely,</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">Michael</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""><br class=""></pre><div class=""><br class=""></div></body></html>