HackerTrans
TopNewTrendsCommentsPastAskShowJobs

urineaut

no profile record

comments

urineaut
·в прошлом месяце·discuss
A pretty nice use case I have for socket activation is for isolating containers or applications from the host network. The great thing about socket activation is that opened sockets carry over even if the application/container unshares into a different network namespace! It also works great with Podman pods with networking in the pod completely disabled and, as those are host sockets, does fully retain the connection info of peers (so logs are not just uselessly containing the gateway IP, depending on the container network config)
urineaut
·3 месяца назад·discuss
That's not a language-specific thing, but is actually part of the IPv6 RFCs as IPv4-mapped IPv6 addresses: [1], [2]

This is super useful because (at least on Linux) IPv6 sockets per default are dual-stack and bind to both IPv6 and IPv6 (except if you are using the IPV6_V6ONLY sockopt or a sysctl), so you don't need to open and handle IPv4 and IPv6 sockets separately (well, maybe some extra code for logging/checking properly with the actual IPv4 address).

That is also documented in ipv6(7):

  IPv4 connections can be handled with the v6 API by using 
  v4-mapped-on-v6 address type; thus a program needs to support only
  this API type to support both protocols.  This is handled
  transparently by the address handling functions in the C library.
  
  IPv4 and IPv6 share the local port space.  When you get an IPv4
  connection or packet to an IPv6 socket, its source address will be
  mapped to v6.
[0]: https://datatracker.ietf.org/doc/html/rfc5156#section-2.2 [1]: https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5....
urineaut
·6 лет назад·discuss
You are right. Sorry, I've been a little bit too quick typing this comment. Unfortunately, it seems I cannot edit the comment anymore.
urineaut
·6 лет назад·discuss
That's not true, although I assume it may be harder to water-proof devices with each possible opening in the chassis.

There are some water-resistant phones with a headphone jack and an IP68 rating even. The LG V30 for example is a beast. Semi-regular usage on rainy days works without any issues. Even using it as a flashlight it survived 30min of pouring rain. I had to wait for the USB-C port to dry up to charge it after getting home, but it still survived without any damage whatsoever.

Other phones that are both water-resistant and have a jack [1]:

* Pixel 3a

* Galaxy S10

* Huawei P30

* and a lot more

If I remember correctly, Apple tried to justify its removal due to its size and water-resistance. I wonder when (not if) Apple will remove the power plug due to "water-resistance" and insist on using Qi charging (even though it has worse efficiency[2]) and cloud services instead of transferring data via cable.

[1]: https://www.androidauthority.com/phones-with-headphone-jack-...

[2]: https://www.wirelesspowerconsortium.com/data/downloadables/1...