Activities of a server 1. Initializes itself 2. Starts listening for clients 3. Handles the following types of Initializing events originating from clients For the server as a whole 1. accepts connections aiting 2. responds to messages start/istening stop listening 3. handles client disconnection aiting for connections 4. May stop accept conne ction listening For each connection han dle Must cleanly terminate O Hand ing a Connection disconnection do: react to messages term inate www.oseng.com O Lethbridge/Laganiere 2001 Chap 3: Basing Development on Reusable 16
© Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 16 Activities of a server 1. Initializes itself 2. Starts listening for clients 3. Handles the following types of events originating from clients 1. accepts connections 2. responds to messages 3. handles client disconnection 4. May stop listening 1. Must cleanly terminate Waiting for Connections Handling a Connection do: react to messages handle disconnection Waiting start listening stop listening For each connection: For the server as a whole: accept connection Initializing term inate
Activities of a client initialize Initializes itself 2. Initiates a connection 3. Sends messages initiate a connection to a server 4. Handles the following ypes of events originating from the interact with the respond to events user triggered by the server server sending messages do: respond to messages 1. responds to messages to the server and as necessary handle server 2. handles server disconnection disconnection 5. Must cleanly terminate terminate www.oseng.com O Lethbridge/Laganiere 2001 Chap 3: Basing Development on Reusable 17
© Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 17 Activities of a client 1. Initializes itself 2. Initiates a connection 3. Sends messages 4. Handles the following types of events originating from the server 1. responds to messages 2. handles server disconnection 5. Must cleanly terminate initiate a connection to a server respond to events triggered by the server do: respond to messages and handle server disconnection interact with the user, sending messages to the server as necessary terminate initialize