Package it.polimi.ingsw.Server
Class WelcomeServer
java.lang.Object
it.polimi.ingsw.Server.WelcomeServer
- All Implemented Interfaces:
Runnable
This is the main server thread.
Expected behaviour: a thread runs forever, accepting all connections and dispatching the sockets to the
Expected behaviour: a thread runs forever, accepting all connections and dispatching the sockets to the
LobbyServer.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWelcomeServer(int port, InetAddress address) Create a new Welcome server, once run the server binds to an address and listens for connections -
Method Summary
Modifier and TypeMethodDescriptionvoidrun()Used when running the server in aThread, will make the server listen for connections, dispatching aLobbyServerfor each new connection.
-
Field Details
-
serverSocket
-
-
Constructor Details
-
WelcomeServer
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 toaddress- the address the server will bind to
-
-
Method Details
-
run
public void run()Used when running the server in aThread, will make the server listen for connections, dispatching aLobbyServerfor each new connection.
-