How does bash > /dev/tcp/"ip"/"port 0<&1 keep its connection alive?

35 Views Asked by At

I have created a tcp socket with /dev/tcp/localhost/9999. I have a nc listening on port 9999. When you create a socket with /dev/tcp, it usually finishes its connection after data is transferred. But when you create a tcp socket by bash > /dev/tcp/localhost/9999 0<&1, it keeps the connection alive waiting for the other side to send data.

I understand that the output of bash is sent over /dev/tcp but how does it keep its connection alive waiting for the other side to send data?

0

There are 0 best solutions below