All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fastchar.socket.FastSocketServerConfig Maven / Gradle / Ivy

package com.fastchar.socket;

import com.fastchar.core.FastChar;
import com.fastchar.interfaces.IFastConfig;
import com.fastchar.socket.server.core.FastSocketServerHelper;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 沈建(Janesen)
 * @date 2021/4/19 13:41
 */
public class FastSocketServerConfig implements IFastConfig {

    static List SOCKET_SERVER_CONFIGS = new ArrayList<>();

    public FastSocketServerConfig() {
        SOCKET_SERVER_CONFIGS.add(this);
    }

    private boolean debug;
    private int socketPort = 8888;//socket端口
    private boolean socketAutoStart;//是否自动启动WebSocket

    public boolean isDebug() {
        return debug;
    }

    public FastSocketServerConfig setDebug(boolean debug) {
        this.debug = debug;
        return this;
    }

    public int getSocketPort() {
        return socketPort;
    }

    public FastSocketServerConfig setSocketPort(int socketPort) {
        this.socketPort = socketPort;
        return this;
    }

    public boolean isSocketAutoStart() {
        return socketAutoStart;
    }

    public FastSocketServerConfig setSocketAutoStart(boolean socketAutoStart) {
        this.socketAutoStart = socketAutoStart;
        return this;
    }

    public FastSocketServerHelper getSocketServer() {
        return FastChar.getOverrides().singleInstance("FastSocketServerConfig" + this.hashCode(), FastSocketServerHelper.class).setServerConfig(this);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy