Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code LNG204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.
javax.net

Class ServerSocketFactory

  • Direct Known Subclasses:
    SSLServerSocketFactory

    public abstract class ServerSocketFactory
    extends Object
    This class creates server sockets. It may be subclassed by other factories, which create particular types of server sockets. This provides a general framework for the addition of public socket-level functionality. It is the server side analogue of a socket factory, and similarly provides a way to capture a variety of policies related to the sockets being constructed.

    Like socket factories, server Socket factory instances have methods used to create sockets. There is also an environment specific default server socket factory; frameworks will often use their own customized factory.

    Since:
    1.4
    See Also:
    SocketFactory
    • Constructor Detail

      • ServerSocketFactory

        protected ServerSocketFactory()
        Creates a server socket factory.
    • Method Detail

      • getDefault

        public static ServerSocketFactory getDefault()
        Returns a copy of the environment's default socket factory.
        Returns:
        the ServerSocketFactory
      • createServerSocket

        public abstract ServerSocket createServerSocket(int port)
                                                 throws IOException
        Returns a server socket bound to the specified port. The socket is configured with the socket options (such as accept timeout) given to this factory.

        If there is a security manager, its checkListen method is called with the port argument as its argument to ensure the operation is allowed. This could result in a SecurityException.

        Parameters:
        port - the port to listen to
        Returns:
        the ServerSocket
        Throws:
        IOException - for networking errors
        SecurityException - if a security manager exists and its checkListen method doesn't allow the operation.
        IllegalArgumentException - if the port parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive.
        See Also:
        SecurityManager.checkListen(int), ServerSocket.ServerSocket(int)
      • createServerSocket

        public abstract ServerSocket createServerSocket(int port,
                                      int backlog)
                                                 throws IOException
        Returns a server socket bound to the specified port, and uses the specified connection backlog. The socket is configured with the socket options (such as accept timeout) given to this factory.

        The backlog argument must be a positive value greater than 0. If the value passed if equal or less than 0, then the default value will be assumed.

        If there is a security manager, its checkListen method is called with the port argument as its argument to ensure the operation is allowed. This could result in a SecurityException.

        Parameters:
        port - the port to listen to
        backlog - how many connections are queued
        Returns:
        the ServerSocket
        Throws:
        IOException - for networking errors
        SecurityException - if a security manager exists and its checkListen method doesn't allow the operation.
        IllegalArgumentException - if the port parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive.
        See Also:
        SecurityManager.checkListen(int), ServerSocket.ServerSocket(int, int)
      • createServerSocket

        public abstract ServerSocket createServerSocket(int port,
                                      int backlog,
                                      InetAddress ifAddress)
                                                 throws IOException
        Returns a server socket bound to the specified port, with a specified listen backlog and local IP.

        The ifAddress argument can be used on a multi-homed host for a ServerSocket that will only accept connect requests to one of its addresses. If ifAddress is null, it will accept connections on all local addresses. The socket is configured with the socket options (such as accept timeout) given to this factory.

        The backlog argument must be a positive value greater than 0. If the value passed if equal or less than 0, then the default value will be assumed.

        If there is a security manager, its checkListen method is called with the port argument as its argument to ensure the operation is allowed. This could result in a SecurityException.

        Parameters:
        port - the port to listen to
        backlog - how many connections are queued
        ifAddress - the network interface address to use
        Returns:
        the ServerSocket
        Throws:
        IOException - for networking errors
        SecurityException - if a security manager exists and its checkListen method doesn't allow the operation.
        IllegalArgumentException - if the port parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive.
        See Also:
        SecurityManager.checkListen(int), ServerSocket.ServerSocket(int, int, java.net.InetAddress)

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-javax/net/ServerSocketFactory.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut