jvdprng
(Joop van de Pol)
January 29, 2026, 10:11am
79
Julien00859:
In this version the user must explicitly call shutdown(SHUT_RD) if he doesn’t care about truncation. If he cares about truncation he gotta call recv() until it returns b''. There’s no force argument, the user must explicitly shutdowns read, or receive everything.
Yeah, this does seem cleaner than what we currently have.
Julien00859:
I solved the forked-server problem thanks to a TLSContext(Client|Server).wrap_socket function. In the parent process (the one that accept()) I create a regular socket (i.e. import socket, not import tlslib). In the child process (the one that recv()/send()) I wrap/upgrade the regular TCP socket to a TLS one using this function. I’ve tested other things but they were less elegant.
Do you have a good idea what the wrap_socket API should look like? In the previous PEP, they wanted to implement the full socket interface, but I’m not sure if this is desirable.
I agree, this is better.