Have to connect and disconnect for others to connect

I have a private server hosted on my PC, and whenever other people want to connect to it, I have to connect and disconnect. Does anyone know how to fix that?