This shouldn't be happening since routing is IP-level phenomenon, and yet it does:
Establish a TCP (or even UDP!) connection:
nc 1.2.3.4 1234
Observe that you can send and receive data via this connection by typing on console and checking the other end of the connection
Create a new route
sudo route add -reject 1.2.3.4 127.0.0.1
Observe that the connection established in step 1 is still working
Try creating a new connection to the same host and observe that it's not transmitting data as expected.
I've tried this many times, including with UDP sockets and the behavior is consistently reproducible. Nothing like this happens on Linux or Windows (as one would expect). The only explanation I have is that there's some special handling of TCP and UDP packets in the OS routing mechanism or something like per-process routing tables. But I can't find any mention of that anywhere. Is there documentation on this behavior and how to change it? Or an alternative explanation?