Home | History | Annotate | Download | only in net
      1 /*******************************************************************************
      2  * Copyright 2011 See AUTHORS file.
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *   http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  ******************************************************************************/
     16 
     17 package com.badlogic.gdx.net;
     18 
     19 /** Options for {@link ServerSocket} instances.
     20  *
     21  * @author mzechner
     22  * @author noblemaster */
     23 public class ServerSocketHints {
     24 
     25 	/** The listen backlog length. Needs to be greater than 0, otherwise the system default is used. backlog is the maximum queue
     26 	 * length for incoming connection, i.e. maximum number of connections waiting for accept(...). If a connection indication
     27 	 * arrives when the queue is full, the connection is refused. */
     28 	public int backlog = 16;
     29 
     30 	/** Performance preferences are described by three integers whose values indicate the relative importance of short connection
     31 	 * time, low latency, and high bandwidth. The absolute values of the integers are irrelevant; in order to choose a protocol the
     32 	 * values are simply compared, with larger values indicating stronger preferences. Negative values represent a lower priority
     33 	 * than positive values. If the application prefers short connection time over both low latency and high bandwidth, for
     34 	 * example, then it could invoke this method with the values (1, 0, 0). If the application prefers high bandwidth above low
     35 	 * latency, and low latency above short connection time, then it could invoke this method with the values (0, 1, 2). */
     36 	public int performancePrefConnectionTime = 0;
     37 	/** See performancePrefConnectionTime for details. */
     38 	public int performancePrefLatency = 1; // low latency
     39 	/** See performancePrefConnectionTime for details. */
     40 	public int performancePrefBandwidth = 0;
     41 	/** Enable/disable the SO_REUSEADDR socket option. */
     42 	public boolean reuseAddress = true;
     43 	/** The SO_TIMEOUT in milliseconds for how long to wait during server.accept(). Enter 0 for infinite wait. */
     44 	public int acceptTimeout = 5000;
     45 	/** The SO_RCVBUF (receive buffer) size in bytes for server.accept(). */
     46 	public int receiveBufferSize = 4096;
     47 }
     48