Operating System代写:CSCI6303 Distributed Operating Systems

代写一个分布式的聊天程序,需要实现登入登出、成员列表、聊天组、单播和广播。

Assumptions

Server – S
Clients – C1, C2, C3, C4, C5
Initial setup: pwd.txt must contain C1, C2, C3 and C5’s password information. C4 is a first time user.
Assume no groups or clients are stored on server at this point.

Functions

Log in and Sign up

  • C1, C2, C3 and C5 log in. This will happen from 4 different chat windows.
  • C4 must sign up and create a new account (i.e., its host name/pwd pair must be added to pwd.txt file)

Visibility and dropdown lists

  • C2 and C3 set themselves to be invisible.
  • Available clients list is populated with C1, C4 and C5 (as C2 and C3 are invisible). This means that only C1, C4 or C5 can receive unicast messages.

Group creation and joining

  • C1 creates a group called G1. G1 must become visible to all logged in clients. When G1 is selected, all members of G1 must be listed somewhere on the side. At this point, it must only list C1.
  • C2 and C4 join group G1. Now if G1 is selected, all members of G1 must be listed somewhere on the side. At this point, it must list C1, C2 and C4.

Note: C2 set itself to be invisible. This means it will not be listed in the available clients list. However, it will be listed when its group is selected. The only way to send messages to C2 is by joining the group G1. You cannot send unicast or broadcast messages to C2.

  • C5 creates a group called G2.
  • C1 and C3 join group G2.
  • The list of available groups must now show G1 and G2.

Unicast, multicast and broadcast

  • C1, C2 and C4 can receive multicast messages but only from one another.
  • C1, C3 and C5 can receive multicast messages but only from one another.
  • Any client (even the invisible clients) can send a broadcast message but it will be received by C1, C4 and C5 (the visible clients).
  • Unicast messages can be sent to the listed available clients: C1, C4 or C5.

Leaving groups/Logging out

  • C2 leaves the group G1. It will no longer be listed as a client in the group G1.
  • C1 logs out. It will no longer be listed as a client in the group G1. Also, it will be removed from the available clients list.

Note: A group is not dissolved when the creator of the group leaves it or logs out. A group is dissolved if the last member of the group leaves it or logs out.

  • C4 logs out. C4 was the last member of group G1. G1 will be dissolved at this point.

Hints

Server will have to maintain separate lists in order to determine who to send unicast, multicast or broadcast messages.