-
Notifications
You must be signed in to change notification settings - Fork 0
Server Information
Dustin Schnelle edited this page May 26, 2018
·
4 revisions
- Create a socket object
- Create a server socket object
- Create an instance of a lobby (limited to 1 lobby)
- Upon successful server setup continuously loop
5a. Wait for a client to communicate with the server (3 possible scenarios)
Scenario #1: The client is new to the server (client's first time connecting)
- Accept the connection from client
- Create a client object
- Add the client object to the connection list
- Welcome the client to the server
Scenario #2: The client is know to the server, so handle the message
- Receive the message from the client
- Decode and normalize the message to lowercase
- Handle the message
Scenario #3: The client sent a null (junk) message
- Receive the message from the client
- Close the clients connection
- Remove the client from the connection list
5b. Wait for an error to occur
- Close the clients socket
- Remove the client from the connection list