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); } }
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); } }
public ServerSocket newServerSocket(Protocol protocol, String hostname, int port, ServerSocketHints hints) { return nativeNet.newServerSocket(protocol, port, hints); }
public ServerSocket newServerSocket(Protocol protocol, int port, ServerSocketHints hints) { return nativeNet.newServerSocket(protocol, port, hints); }
@Override public ServerSocket newServerSocket (Protocol protocol, String hostname, int port, ServerSocketHints hints) { return new NetJavaServerSocketImpl(protocol, hostname, port, hints); }
public ServerSocket newServerSocket (Protocol protocol, int port, ServerSocketHints hints) { return new NetJavaServerSocketImpl(protocol, port, hints); }
@Override public ServerSocket newServerSocket(final Protocol protocol, final String hostname, final int port, final ServerSocketHints hints) { return net.newServerSocket(protocol, hostname, port, hints); }
@Override public ServerSocket newServerSocket(final Protocol protocol, final int port, final ServerSocketHints hints) { return net.newServerSocket(protocol, port, hints); }
@Override public ServerSocket newServerSocket (Protocol protocol, int port, ServerSocketHints hints) { throw new UnsupportedOperationException("Not implemented"); }
@Override public ServerSocket newServerSocket (Protocol protocol, int port, ServerSocketHints hints) { return new NetJavaServerSocketImpl(protocol, port, hints); }
@Override public ServerSocket newServerSocket(Protocol protocol, int port, ServerSocketHints hints) { return new ServerApplicationSocket(protocol, port, hints); }
/** 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);