mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
Set SocketWriteTimeout to 10 seconds.
This commit is contained in:
parent
ed341528d9
commit
35791ac6b7
9 changed files with 164 additions and 154 deletions
|
|
@ -27,6 +27,12 @@
|
|||
*/
|
||||
package mage.server;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.*;
|
||||
import javax.management.MBeanServer;
|
||||
import mage.cards.ExpansionSet;
|
||||
import mage.cards.Sets;
|
||||
import mage.cards.repository.CardScanner;
|
||||
|
|
@ -59,13 +65,6 @@ import org.jboss.remoting.transporter.TransporterClient;
|
|||
import org.jboss.remoting.transporter.TransporterServer;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import javax.management.MBeanServer;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
|
|
@ -202,6 +201,7 @@ public final class Main {
|
|||
logger.info("Config - save game active: " + (config.isSaveGameActivated() ? "true" : "false"));
|
||||
logger.info("Config - backlog size : " + config.getBacklogSize());
|
||||
logger.info("Config - lease period : " + config.getLeasePeriod());
|
||||
logger.info("Config - sock wrt timeout: " + config.getSocketWriteTimeout());
|
||||
logger.info("Config - max pool size : " + config.getMaxPoolSize());
|
||||
logger.info("Config - num accp.threads: " + config.getNumAcceptThreads());
|
||||
logger.info("Config - second.bind port: " + config.getSecondaryBindPort());
|
||||
|
|
@ -244,7 +244,7 @@ public final class Main {
|
|||
|
||||
static boolean isAlreadyRunning(InvokerLocator serverLocator) {
|
||||
Map<String, String> metadata = new HashMap<>();
|
||||
metadata.put(SocketWrapper.WRITE_TIMEOUT, "2000");
|
||||
metadata.put(SocketWrapper.WRITE_TIMEOUT, String.valueOf(ConfigSettings.instance.getSocketWriteTimeout()));
|
||||
metadata.put("generalizeSocketException", "true");
|
||||
try {
|
||||
MageServer testServer = (MageServer) TransporterClient.createTransporterClient(serverLocator.getLocatorURI(), MageServer.class, metadata);
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@
|
|||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
*/
|
||||
package mage.server.util;
|
||||
|
||||
import java.io.File;
|
||||
|
|
@ -33,7 +32,6 @@ import java.util.List;
|
|||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
|
||||
import mage.server.util.config.Config;
|
||||
import mage.server.util.config.GamePlugin;
|
||||
import mage.server.util.config.Plugin;
|
||||
|
|
@ -48,7 +46,6 @@ public enum ConfigSettings {
|
|||
|
||||
private Config config;
|
||||
|
||||
|
||||
ConfigSettings() {
|
||||
try {
|
||||
JAXBContext jaxbContext = JAXBContext.newInstance("mage.server.util.config");
|
||||
|
|
@ -79,6 +76,10 @@ public enum ConfigSettings {
|
|||
return config.getServer().getLeasePeriod().intValue();
|
||||
}
|
||||
|
||||
public int getSocketWriteTimeout() {
|
||||
return config.getServer().getSocketWriteTimeout().intValue();
|
||||
}
|
||||
|
||||
public int getMaxPoolSize() {
|
||||
return config.getServer().getMaxPoolSize().intValue();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
numAcceptThreads="2"
|
||||
maxPoolSize="300"
|
||||
leasePeriod="5000"
|
||||
socketWriteTimeout="10000"
|
||||
maxGameThreads="10"
|
||||
maxSecondsIdle="600"
|
||||
minUserNameLength="3"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue