Java 类com.badlogic.gdx.net.ServerSocket 实例源码

项目:libgdxcn    文件:NetJavaServerSocketImpl.java   
public NetJavaServerSocketImpl (Protocol protocol, int port, ServerSocketHints hints) {
    this.protocol = protocol;

    // create the server socket
    try {
        // initialize
        server = new java.net.ServerSocket();
        if (hints != null) {
            server.setPerformancePreferences(hints.performancePrefConnectionTime, hints.performancePrefLatency,
                hints.performancePrefBandwidth);
            server.setReuseAddress(hints.reuseAddress);
            server.setSoTimeout(hints.acceptTimeout);
            server.setReceiveBufferSize(hints.receiveBufferSize);
        }

        // and bind the server...
        InetSocketAddress address = new InetSocketAddress(port);
        if (hints != null) {
            server.bind(address, hints.backlog);
        } else {
            server.bind(address);
        }
    } catch (Exception e) {
        throw new GdxRuntimeException("Cannot create a server socket at port " + port + ".", e);
    }
}
项目:LibGDXServer    文件:ServerApplicationSocket.java   
public ServerApplicationSocket(Net.Protocol protocol, int port, ServerSocketHints hints) {
    this.protocol = protocol;

    // create the server socket
    try {
        // initialize
        server = new java.net.ServerSocket();
        if (hints != null) {
            server.setPerformancePreferences(hints.performancePrefConnectionTime,
                    hints.performancePrefLatency,
                    hints.performancePrefBandwidth);
            server.setReuseAddress(hints.reuseAddress);
            server.setSoTimeout(hints.acceptTimeout);
            server.setReceiveBufferSize(hints.receiveBufferSize);
        }

        // and bind the server...
        InetSocketAddress address = new InetSocketAddress(port);
        if (hints != null) {
            server.bind(address, hints.backlog);
        } else {
            server.bind(address);
        }
    } catch (Exception e) {
        throw new GdxRuntimeException("Cannot create a server socket at port " + port + ".", e);
    }
}
项目:JavityEngine    文件:JavityNet.java   
public ServerSocket newServerSocket(Protocol protocol, String hostname, int port, ServerSocketHints hints) {
    return nativeNet.newServerSocket(protocol, port, hints);
}
项目:JavityEngine    文件:JavityNet.java   
public ServerSocket newServerSocket(Protocol protocol, int port, ServerSocketHints hints) {
    return nativeNet.newServerSocket(protocol, port, hints);
}
项目:gdx-backend-jglfw    文件:JglfwNet.java   
@Override
public ServerSocket newServerSocket (Protocol protocol, String hostname, int port, ServerSocketHints hints) {
    return new NetJavaServerSocketImpl(protocol, hostname, port, hints);
}
项目:gdx-backend-jglfw    文件:JglfwNet.java   
public ServerSocket newServerSocket (Protocol protocol, int port, ServerSocketHints hints) {
    return new NetJavaServerSocketImpl(protocol, port, hints);
}
项目:gdx-lml    文件:ExtendedNet.java   
@Override
public ServerSocket newServerSocket(final Protocol protocol, final String hostname, final int port,
        final ServerSocketHints hints) {
    return net.newServerSocket(protocol, hostname, port, hints);
}
项目:gdx-lml    文件:ExtendedNet.java   
@Override
public ServerSocket newServerSocket(final Protocol protocol, final int port, final ServerSocketHints hints) {
    return net.newServerSocket(protocol, port, hints);
}
项目:libgdxcn    文件:JglfwNet.java   
public ServerSocket newServerSocket (Protocol protocol, int port, ServerSocketHints hints) {
    return new NetJavaServerSocketImpl(protocol, port, hints);
}
项目:libgdxcn    文件:GwtNet.java   
@Override
public ServerSocket newServerSocket (Protocol protocol, int port, ServerSocketHints hints) {
    throw new UnsupportedOperationException("Not implemented");
}
项目:libgdxcn    文件:HeadlessNet.java   
@Override
public ServerSocket newServerSocket (Protocol protocol, int port, ServerSocketHints hints) {
    return new NetJavaServerSocketImpl(protocol, port, hints);
}
项目:libgdxcn    文件:IOSNet.java   
@Override
public ServerSocket newServerSocket (Protocol protocol, int port, ServerSocketHints hints) {
    return new NetJavaServerSocketImpl(protocol, port, hints);
}
项目:libgdxcn    文件:LwjglNet.java   
@Override
public ServerSocket newServerSocket (Protocol protocol, int port, ServerSocketHints hints) {
    return new NetJavaServerSocketImpl(protocol, port, hints);
}
项目:libgdxcn    文件:AndroidNet.java   
@Override
public ServerSocket newServerSocket (Protocol protocol, int port, ServerSocketHints hints) {
    return new NetJavaServerSocketImpl(protocol, port, hints);
}
项目:TinyVoxel    文件:GwtNet.java   
@Override
public ServerSocket newServerSocket (Protocol protocol, int port, ServerSocketHints hints) {
    throw new UnsupportedOperationException("Not implemented");
}
项目:LibGDXServer    文件:ServerNet.java   
@Override
public ServerSocket newServerSocket(Protocol protocol, int port, ServerSocketHints hints) {
    return new ServerApplicationSocket(protocol, port, hints);
}
项目:mini2Dx    文件:IOSMini2DxNet.java   
@Override
public ServerSocket newServerSocket (Protocol protocol, String hostname, int port, ServerSocketHints hints) {
    return new NetJavaServerSocketImpl(protocol, hostname, port, hints);
}
项目:mini2Dx    文件:IOSMini2DxNet.java   
@Override
public ServerSocket newServerSocket (Protocol protocol, int port, ServerSocketHints hints) {
    return new NetJavaServerSocketImpl(protocol, port, hints);
}
项目:libgdxcn    文件:Net.java   
/** Creates a new server socket on the given port, using the given {@link Protocol}, waiting for incoming connections.
 * 
 * @param port the port to listen on
 * @param hints additional {@link ServerSocketHints} used to create the socket. Input null to use the default setting provided
 *           by the system.
 * @return the {@link ServerSocket}
 * @throws GdxRuntimeException in case the socket couldn't be opened */
public ServerSocket newServerSocket (Protocol protocol, int port, ServerSocketHints hints);