問題描述
通過java運行的執行程序似乎超時? (Executed programs run through java seem to time out?)
I have an IRC bot which accepts commands from users to host specific game servers. However, after about half an hour to an hour of having the server up, the server just freezes up. The server is ran using Java's runtime execute command.
Is there a way to keep the server up until the user manually terminates the server?
If it matters, the OS is CentOS 6, 64bit.
Here is an example string command that is passed through to Java's runtime exectute: http://pastebin.com/mn8qWf3E
Edit: I'm not sure if the process hangs or crashes, as I did not check. I've ran the server again and will check once I find out.
Thank you!
參考解法
方法 1:
just a guess.. make sure you keep reading the output of the server from the java process , or redirect it somewhere. otherwise it will block when it prints something in stdout or err
(by Ivan、Markus Mikkolainen)