通過java運行的執行程序似乎超時? (Executed programs run through java seem to time out?)


問題描述

通過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 IvanMarkus Mikkolainen)

參考文件

  1. Executed programs run through java seem to time out? (CC BY-SA 3.0/4.0)

#runtime #java #Centos #linux #runtime.exec






相關問題

通過java運行的執行程序似乎超時? (Executed programs run through java seem to time out?)

Kesalahan NullPointerException dalam kode Java saya. (NullPointerException errors in my Java code.)

Hentikan proses anak ketika proses induk berhenti (Stop child process when parent process stops)

Атрымаць шлях выканання кансольнага скрыпта Python (Get the runpath of a python console-script)

選擇不包含主要類型 - 錯誤 (Selection does not contain main type - error)

在活動之間使用意圖錯誤 (using intents between activities error)

在運行時使用 Spring 在表中創建新字段 (Create new field into a table with Spring at runtime)

如何添加運行時超時以防止 java.net.SocketTimeoutException? (How do I add a runtime timeout to prevent java.net.SocketTimeoutException?)

我有什麼方法可以覆蓋 Java 中的系統屬性嗎? (Do I have any method to override System Properties in Java?)

如何計算此代碼的時間複雜度? (How can I compute the time complexity of this code?)

運行 .exe 文件生成 bt jar2exe 軟件時出現 java runtime environment not found 錯誤 (Getting java runtime enviroment not found error while running .exe file produced bt jar2exe software)

在運行時在 VBA 中顯示所有變量及其值 (Show all variables and their values in VBA during runtime)







留言討論