Class ClientListener

java.lang.Object
java.lang.Thread
org.basex.server.ClientListener
All Implemented Interfaces:
Runnable, ClientInfo

public final class ClientListener extends Thread implements ClientInfo
Server-side client session in the client-server architecture.
Author:
BaseX Team 2005-21, BSD License, Andreas Weiler, Christian Gruen
  • Field Details

    • timeout

      public final Timer timeout
      Timer for authentication time out.
    • last

      public long last
      Timestamp of last interaction.
  • Constructor Details

    • ClientListener

      public ClientListener(Socket socket, Context context, BaseXServer server)
      Constructor.
      Parameters:
      socket - socket
      context - database context
      server - server reference
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • close

      public void close()
      Closes the session.
    • context

      public Context context()
      Returns the context of this session.
      Returns:
      user reference
    • clientName

      public String clientName()
      Description copied from interface: ClientInfo
      Returns the name of the current client.
      Specified by:
      clientName in interface ClientInfo
      Returns:
      name of client
    • clientAddress

      public String clientAddress()
      Description copied from interface: ClientInfo
      Returns the host and port of a client.
      Specified by:
      clientAddress in interface ClientInfo
      Returns:
      address of client
    • toString

      public String toString()
      Overrides:
      toString in class Thread