Nathaniel J. Smith
Nathaniel J. Smith
@sscherfke I am familiar with it, but I find that `src/` adds some small but real overhead to operations I do dozens of times a day, like "look at a...
Some notes: I think the way to do this is to provide a hook for the socket and socketpair constructors, and for getaddrinfo and getnameinfo, and put the bulk of...
It would be neat to have a built in randomized/flakey-network mode; think like a 1 button hypothesis test suite for network protocol annoyances. Possibly this might work like: run the...
# I added hooks! #253 implements the core hooks needed to enable this. Specifically, I decided to allow hooking the main `socket` constructor (when `fileno=` is not given), the is-this-a-trio-socket...
@dmcooke: Oh huh yeah, that's a good idea. Any interest in putting together a PR? `is_trio_socket` etc. aren't in a release yet, so if we do it soonish we can...
On further thought... let's keep it simple and just do: ```python class SocketType: def __init__(self): raise TypeError("use trio.socket.socket() to create a SocketType object") ``` and then the way you mark...
Switching from `is_trio_socket` to `isinstance(..., trio.socket.SocketType)` is done in #326.
This is a really excellent talk on using simulated networks etc. for robustness testing in a real system: https://www.youtube.com/watch?v=4fFDFbi3toc
The reason for the exact type check is that Trio needs the socket that's passed in be a real socket that it can pass into low-level OS syscalls – merely...
@mehaase Yeah, don't read too much into my year-and-a-bit-ago initial thinking-out-loud :-). At that point I hadn't even figured out yet mock networking was something that be built into trio's...