SEModCommunity / SE-Community-Mod-API

Space Engineers Community Modding API
GNU Lesser General Public License v3.0
60 stars 47 forks source link

SE Stopped Status before SE service stop #158

Open jboss38 opened 9 years ago

jboss38 commented 9 years ago

Hi,

I'm using a AutoRestart system for SE Server but the SESE service don't seam to wait for the underlying SE server to really stop before displaying a stopped status

so i get this error : 2014-09-14 15:14:45.022 - Thread: 11 -> Error starting Steam dedicated server: Server port 27016 already in use

And if i'm not here to manually reboot it will never start.

Could you fix this please ?

jboss38 commented 9 years ago

So ? any update ?

LordXaosa commented 9 years ago

I know the problem... m_runServerThread.Interrupt(); It should kill server thread only when it will wait for something (like Thread.Sleep etc.) And server process doesn't do it, or do it very rare times (if big map may be). So for now there are two solutions:

  1. m_runServerThread.Abort(); but it's not cool
  2. find method, that fires after Ctrl+C key combination and invoke it, for correct server stop.
fvgoulet commented 9 years ago

There should be a Join on this thread, killing a thread is avoiding the problem.