Class WelcomeServer

java.lang.Object
it.polimi.ingsw.Server.WelcomeServer
All Implemented Interfaces:
Runnable

public class WelcomeServer extends Object implements Runnable
This is the main server thread.
Expected behaviour: a thread runs forever, accepting all connections and dispatching the sockets to the LobbyServer.
  • Field Details

  • Constructor Details

    • WelcomeServer

      public WelcomeServer(int port, InetAddress address)
      Create a new Welcome server, once run the server binds to an address and listens for connections
      Parameters:
      port - the port the server will bind to
      address - the address the server will bind to
  • Method Details

    • run

      public void run()
      Used when running the server in a Thread, will make the server listen for connections, dispatching a LobbyServer for each new connection.
      Specified by:
      run in interface Runnable