Elektrine lite

← Feed

@dalias@hachyderm.io

Post #2768157

2023-12-12 15:01 UTC

@ck@chaos.social @Mer__edith@mastodon.world Specifically, I'm asking what kind of polling they're doing, and why, when the standard correct way to do this kind of operation is sleeping (in the confusingly named poll function) waiting for input on a socket, where the kernel is responsible for waking you only once input is available. There are hideous NAT connection dropping issues related to this, but solvable with a mix of TCP keepalive (also kernel side, so virtually free) and waking & reconnecting on closed sockets.

Replies (1)

  • @ck@chaos.social 2023-12-12 15:31

    @dalias@hachyderm.io Essentially, Android apps are not native Linux programs. They run on top of a virtual machine that abstracts away the operating system capabilities to a degree deemed necessary by Google. Specifically, when your app is sent to sleep by the VM because of inactivity, your socket will time out. Android is a Linux in name only and the abstractions put in place by Google do not support (or rather: not allow) what you suggest.

    Open ##2768158