I use vlc to read the video file and then generate a http stream to another system. But the stream will stop for nearly 3 seconds and I need re-connect this stream.

To fix this, we can use "-sout-keep", for example:

$ cvlc -vvv ***.avi --sout '#standard{access=http,mux=ts,dst=:1234}' --sout-keep --repeat
-sout-keep, -no-sout-keep: Keep sout open (default disabled) : use the same sout instance across the various playlist items, if possible.

-repeat: repeat the current video file

-loop:  repeat all