Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

I use netcat to simulate a network connectivity failures.

For instance, if server:port 1000 is the normal host and port my application would connect to, I set up a forward from port 2000:

    nc -L server:1000 2000
then run my application to connect to localhost:2000

    my_application --server=localhost --port=2000
Now my application is connected to localhost:2000, which is forwarded to server:1000 through netcat. To simulate a network connectivity failure I just kill netcat.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: