Java Code Examples for cn.nukkit.utils.ThreadedLogger

The following examples show how to use cn.nukkit.utils.ThreadedLogger. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Jupiter   Source File: UDPServerSocket.java    License: GNU General Public License v3.0 6 votes vote down vote up
public UDPServerSocket(ThreadedLogger logger, int port, String interfaz) {
    this.logger = logger;
    try {
        bootstrap = new Bootstrap();
        group = new NioEventLoopGroup();
        bootstrap
                .group(group)
                .channel(NioDatagramChannel.class)
                .handler(this);
        channel = bootstrap.bind(interfaz, port).sync().channel();
    } catch (Exception e) {
        this.logger.critical(FastAppender.get(interfaz, ":", port, " 上でサーバーを開けませんでした。"));
        this.logger.critical("同じポートで複数のサーバーを一度に開いていませんか?");
        System.exit(1);
    }
}
 
Example 2
Source Project: Nukkit   Source File: UDPServerSocket.java    License: GNU General Public License v3.0 6 votes vote down vote up
public UDPServerSocket(ThreadedLogger logger, int port, String interfaz) {
    this.logger = logger;
    try {
            bootstrap = new Bootstrap()
                    .channel(EPOLL ? EpollDatagramChannel.class : NioDatagramChannel.class)
                    .option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT)
                    .handler(this)
                    .group(EPOLL ? new EpollEventLoopGroup() : new NioEventLoopGroup());
            this.logger.info("Epoll Status is " + EPOLL);
        channel = bootstrap.bind(interfaz, port).sync().channel();
    } catch (Exception e) {
        this.logger.critical("**** FAILED TO BIND TO " + interfaz + ":" + port + "!");
        this.logger.critical("Perhaps a server is already running on that port?");
        System.exit(1);
    }
}
 
Example 3
Source Project: Nukkit   Source File: UDPServerSocket.java    License: GNU General Public License v3.0 6 votes vote down vote up
public UDPServerSocket(ThreadedLogger logger, int port, String interfaz) {
    this.logger = logger;
    try {
        if (Epoll.isAvailable()) {
            bootstrap = new Bootstrap()
                    .channel(EpollDatagramChannel.class)
                    .option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT)
                    .handler(this)
                    .group(new EpollEventLoopGroup());
            this.logger.info("Epoll is available. EpollEventLoop will be used.");
        } else {
            bootstrap = new Bootstrap()
                    .group(new NioEventLoopGroup())
                    .channel(NioDatagramChannel.class)
                    .option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT)
                    .handler(this);
            this.logger.info("Epoll is unavailable. Reverting to NioEventLoop.");
        }
        channel = bootstrap.bind(interfaz, port).sync().channel();
    } catch (Exception e) {
        this.logger.critical("**** FAILED TO BIND TO " + interfaz + ":" + port + "!");
        this.logger.critical("Perhaps a server is already running on that port?");
        System.exit(1);
    }
}
 
Example 4
Source Project: Jupiter   Source File: RakNetServer.java    License: GNU General Public License v3.0 5 votes vote down vote up
public RakNetServer(ThreadedLogger logger, int port, String interfaz) {
    this.port = port;
    if (port < 1 || port > 65536) {
        throw new IllegalArgumentException("Invalid port range");
    }

    this.interfaz = interfaz;
    this.logger = logger;

    this.externalQueue = new ConcurrentLinkedQueue<>();
    this.internalQueue = new ConcurrentLinkedQueue<>();

    this.start();
}
 
Example 5
Source Project: Nukkit   Source File: RakNetServer.java    License: GNU General Public License v3.0 5 votes vote down vote up
public RakNetServer(ThreadedLogger logger, int port, String interfaz) {
    this.port = port;
    if (port < 1 || port > 65536) {
        throw new IllegalArgumentException("Invalid port range");
    }

    this.interfaz = interfaz;
    this.logger = logger;

    this.externalQueue = new ConcurrentLinkedQueue<>();
    this.internalQueue = new ConcurrentLinkedQueue<>();

    this.start();
}
 
Example 6
Source Project: SynapseAPI   Source File: SynapseClient.java    License: GNU General Public License v3.0 5 votes vote down vote up
public SynapseClient(ThreadedLogger logger, int port, String interfaz) {
    this.logger = logger;
    this.interfaz = interfaz;
    this.port = port;
    if (port < 1 || port > 65536) {
        throw new IllegalArgumentException("Invalid port range");
    }
    this.shutdown = false;
    this.externalQueue = new ConcurrentLinkedQueue<>();
    this.internalQueue = new ConcurrentLinkedQueue<>();

    this.start();
}
 
Example 7
Source Project: Nukkit   Source File: RakNetServer.java    License: GNU General Public License v3.0 5 votes vote down vote up
public RakNetServer(ThreadedLogger logger, int port, String interfaz) {
    this.port = port;
    if (port < 1 || port > 65536) {
        throw new IllegalArgumentException("Invalid port range");
    }

    this.interfaz = interfaz;
    this.logger = logger;

    this.externalQueue = new ConcurrentLinkedQueue<>();
    this.internalQueue = new ConcurrentLinkedQueue<>();

    this.start();
}
 
Example 8
Source Project: Jupiter   Source File: UDPServerSocket.java    License: GNU General Public License v3.0 4 votes vote down vote up
public UDPServerSocket(ThreadedLogger logger) {
    this(logger, 19132, "0.0.0.0");
}
 
Example 9
Source Project: Jupiter   Source File: UDPServerSocket.java    License: GNU General Public License v3.0 4 votes vote down vote up
public UDPServerSocket(ThreadedLogger logger, int port) {
    this(logger, port, "0.0.0.0");
}
 
Example 10
Source Project: Jupiter   Source File: SessionManager.java    License: GNU General Public License v3.0 4 votes vote down vote up
public ThreadedLogger getLogger() {
    return this.server.getLogger();
}
 
Example 11
Source Project: Jupiter   Source File: RakNetServer.java    License: GNU General Public License v3.0 4 votes vote down vote up
public RakNetServer(ThreadedLogger logger, int port) {
    this(logger, port, "0.0.0.0");
}
 
Example 12
Source Project: Jupiter   Source File: RakNetServer.java    License: GNU General Public License v3.0 4 votes vote down vote up
public ThreadedLogger getLogger() {
    return logger;
}
 
Example 13
Source Project: Nukkit   Source File: UDPServerSocket.java    License: GNU General Public License v3.0 4 votes vote down vote up
public UDPServerSocket(ThreadedLogger logger) {
    this(logger, 19132, "0.0.0.0");
}
 
Example 14
Source Project: Nukkit   Source File: UDPServerSocket.java    License: GNU General Public License v3.0 4 votes vote down vote up
public UDPServerSocket(ThreadedLogger logger, int port) {
    this(logger, port, "0.0.0.0");
}
 
Example 15
Source Project: Nukkit   Source File: SessionManager.java    License: GNU General Public License v3.0 4 votes vote down vote up
public ThreadedLogger getLogger() {
    return this.server.getLogger();
}
 
Example 16
Source Project: Nukkit   Source File: RakNetServer.java    License: GNU General Public License v3.0 4 votes vote down vote up
public RakNetServer(ThreadedLogger logger, int port) {
    this(logger, port, "0.0.0.0");
}
 
Example 17
Source Project: Nukkit   Source File: RakNetServer.java    License: GNU General Public License v3.0 4 votes vote down vote up
public ThreadedLogger getLogger() {
    return logger;
}
 
Example 18
Source Project: SynapseAPI   Source File: SynapseClient.java    License: GNU General Public License v3.0 4 votes vote down vote up
public SynapseClient(ThreadedLogger logger, int port) {
    this(logger, port, "127.0.0.1");
}
 
Example 19
Source Project: SynapseAPI   Source File: SynapseClient.java    License: GNU General Public License v3.0 4 votes vote down vote up
public ThreadedLogger getLogger() {
    return logger;
}
 
Example 20
Source Project: Nukkit   Source File: UDPServerSocket.java    License: GNU General Public License v3.0 4 votes vote down vote up
public UDPServerSocket(ThreadedLogger logger) {
    this(logger, 19132, "0.0.0.0");
}
 
Example 21
Source Project: Nukkit   Source File: UDPServerSocket.java    License: GNU General Public License v3.0 4 votes vote down vote up
public UDPServerSocket(ThreadedLogger logger, int port) {
    this(logger, port, "0.0.0.0");
}
 
Example 22
Source Project: Nukkit   Source File: SessionManager.java    License: GNU General Public License v3.0 4 votes vote down vote up
public ThreadedLogger getLogger() {
    return this.server.getLogger();
}
 
Example 23
Source Project: Nukkit   Source File: RakNetServer.java    License: GNU General Public License v3.0 4 votes vote down vote up
public RakNetServer(ThreadedLogger logger, int port) {
    this(logger, port, "0.0.0.0");
}
 
Example 24
Source Project: Nukkit   Source File: RakNetServer.java    License: GNU General Public License v3.0 4 votes vote down vote up
public ThreadedLogger getLogger() {
    return logger;
}