@Override public ServerSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth) { javaSocket.setPerformancePreferences(connectionTime, latency, bandwidth); return this; }
@Override public ServerSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth) { javaSocket.setPerformancePreferences(connectionTime, latency, bandwidth); return this; }
@Override public ServerSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth) { javaSocket.setPerformancePreferences(connectionTime, latency, bandwidth); return this; }
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth) { socket.setPerformancePreferences(connectionTime, latency, bandwidth); }
public NetJavaServerSocketImpl (Protocol protocol, String hostname, 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; if( hostname != null ) { address = new InetSocketAddress(hostname, port); } else { 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 NetJavaServerSocketImpl (Protocol protocol, String hostname, 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; if( hostname != null ) { address = new InetSocketAddress(hostname, port); } else { 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); } }
private ServerSocket createServerSocket( int port ) throws IOException { ServerSocket serverSocket = new ServerSocket(); serverSocket.setPerformancePreferences( 1, 2, 3 ); // order of importance: bandwidth, latency, connection time serverSocket.setReuseAddress( true );
@Signature({@Arg("connectTime"), @Arg("latency"), @Arg("bandWidth")}) public Memory setPerformancePreferences(Environment env, Memory... args) throws SocketException { socket.setPerformancePreferences(args[0].toInteger(), args[1].toInteger(), args[2].toInteger()); return Memory.NULL; }
@Override protected void doStart() throws IOException { this.serverSocketChannel = ServerSocketChannel.open(); this.serverSocketChannel.socket().setSoTimeout(this.soTimeout); if (this.connectionTime != 0 || this.latency != 0 || this.bandwidth != 0) { this.serverSocketChannel.socket().setPerformancePreferences(this.connectionTime, this.latency, this.bandwidth); } this.serverSocketChannel.configureBlocking(false); if (this.socketOptions.get(StandardSocketOption.SO_REUSEADDR) != null) { this.serverSocketChannel.socket().setReuseAddress(StandardSocketOption.SO_REUSEADDR.type() .cast(this.socketOptions.get(StandardSocketOption.SO_REUSEADDR))); } if (this.socketOptions.get(StandardSocketOption.SO_RCVBUF) != null) { this.serverSocketChannel.socket().setReceiveBufferSize(StandardSocketOption.SO_RCVBUF.type() .cast(this.socketOptions.get(StandardSocketOption.SO_RCVBUF))); } if (this.localSocketAddress != null) { this.serverSocketChannel.socket().bind(this.localSocketAddress, this.backlog); } else { this.serverSocketChannel.socket().bind(new InetSocketAddress("localhost", 0), this.backlog); } setLocalSocketAddress( (InetSocketAddress) this.serverSocketChannel.socket().getLocalSocketAddress()); this.selectorManager.registerChannel(this.serverSocketChannel, SelectionKey.OP_ACCEPT, null); }
@Override public void setPerformancePreferences(int connectionTime, int latency, int bandwidth) { ss.setPerformancePreferences(connectionTime, latency, bandwidth); } }
@Override public ServerSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth) { javaSocket.setPerformancePreferences(connectionTime, latency, bandwidth); return this; }
@Override public ServerSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth) { javaSocket.setPerformancePreferences(connectionTime, latency, bandwidth); return this; }
@Override public ServerSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth) { javaSocket.setPerformancePreferences(connectionTime, latency, bandwidth); return this; }
@Override public void setPerformancePreferences(int connectionTime, int latency, int bandwidth){ super.setPerformancePreferences(connectionTime, latency, bandwidth); }
@Override public ServerSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth) { javaSocket.setPerformancePreferences(connectionTime, latency, bandwidth); return this; }
@Override public ServerSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth) { javaSocket.setPerformancePreferences(connectionTime, latency, bandwidth); return this; }
@Override public ServerSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth) { javaSocket.setPerformancePreferences(connectionTime, latency, bandwidth); return this; }
/** * {@inheritDoc} * * Forwards to {@link #delegate}. */ @Override public void setPerformancePreferences(int connectionTime, int latency, int bandwidth) { delegate.setPerformancePreferences(connectionTime, latency, bandwidth); }
@Override public ServerSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth) { javaSocket.setPerformancePreferences(connectionTime, latency, bandwidth); return this; }
@Override public ServerSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth) { javaSocket.setPerformancePreferences(connectionTime, latency, bandwidth); return this; }