MopeSWTP-SS21 / MopeSWTP

MIT License
1 stars 0 forks source link

Server should report that it can be stopped by pressing enter #73

Open CSchoel opened 3 years ago

CSchoel commented 3 years ago

I just found this out by accident, because i was using CTRL-C and was wondering if there wasn't a better way to gracefully shutdown the server. There should be a short info in the logs about this behavior and it should also be mentioned in the README.

CSchoel commented 3 years ago

Also I just found out that you cannot stop the server right after it was started and before any clients were connected. Maybe this should be fixed in #53 .

manuEbg commented 3 years ago

I think the Server should not be able to be stopped by pressing enter. This was just an fast solution to prevent the Server Thread from terminating. I also think this should be fixed in #53

CSchoel commented 3 years ago

Hm, interesting point. I also pondered, if there is a more proper way to shutdown the server process without any input from the client - because I believe there should be a way so that the server can be used even with a client that is not well-behaved.

The thing is that the "correct" way would be reacting to SIGINT (CTRL+C). This can be a little tricky and so I did not want to burden you with this. But after a quick research I think it should be very doable with a shutdown hook.