// (4) Send The Recieved Data to All Clients in The Room
        private static void OnRecievedData(IAsyncResult ar)
        {
            SocketCoderClient client = (SocketCoderClient)ar.AsyncState;
            byte[] aryRet = client.GetRecievedData(ar);

            if (aryRet.Length < 1)
            {
                // client.Sock.RemoteEndPoint - "has left the room"
                client.ReadOnlySocket.Shutdown(SocketShutdown.Both);
                client.ReadOnlySocket.Close();
            //    ClientsList.Remove(client);
                return;
            }

            try
            {
                MemoryStream msgStream = new MemoryStream();
                ClientCommand msgCommand = new ClientCommand();
                msgStream.Write(aryRet, 0, aryRet.Length);
                BinaryFormatter deserializer = new BinaryFormatter();
                msgStream.Position = 0;
                msgCommand = (ClientCommand)deserializer.Deserialize(msgStream);
                switch (msgCommand.MessageType)
                {
                    case ClientCommand.msgType.JoinRoom:
                        ArrayList RoomMembers;
                        if (Clients.ContainsKey(msgCommand.ChatRoomID))
                        {
                            RoomMembers = Clients[msgCommand.ChatRoomID];
                            client.username = msgCommand.Sender;
                            RoomMembers.Add(client);
                            Clients[msgCommand.ChatRoomID] = RoomMembers;
                        }
                        else
                        {
                            RoomMembers = new ArrayList();
                            client.username = msgCommand.Sender;
                            RoomMembers.Add(client);
                            Clients.Add(msgCommand.ChatRoomID, RoomMembers);
                        }
                        try
                        {
                            Member member = new Member();
                            member.AddNew();
                            member.ChatRoomID = msgCommand.ChatRoomID;
                            member.MemberID = msgCommand.Sender;
                            member.Save();
                        }
                        catch (Exception ex)
                        {

                        }

                        ArrayList Members1 = Clients[msgCommand.ChatRoomID];
                        for (int i = 0; i < Members1.Count; i++)
                        {
                            SocketCoderClient Current = (SocketCoderClient)Members1[i];
                            Current.ReadOnlySocket.Send(aryRet);
                        }
                        //OnLogText(null, new EventArgs(), "user : "******" has joined room : " + msgCommand.ChatRoomID.ToString());
                        break;
                    case ClientCommand.msgType.LeaveRoom:
                        try
                        {
                            Member memberToLeave = new Member();
                            memberToLeave.LoadByPrimaryKey(msgCommand.Sender, msgCommand.ChatRoomID);
                            memberToLeave.MarkAsDeleted();
                            memberToLeave.Save();
                        }
                        catch (Exception ex)
                        {

                        }
                        ArrayList Members2 = Clients[msgCommand.ChatRoomID];
                        for (int i = 0; i < Members2.Count; i++)
                        {
                            SocketCoderClient Current = (SocketCoderClient)Members2[i];
                            if (Current.username != msgCommand.Sender)
                                Current.ReadOnlySocket.Send(aryRet);
                        }

                        ArrayList MemberToRemove = Clients[msgCommand.ChatRoomID];
                        for (int i = 0; i < MemberToRemove.Count; i++)
                        {
                            SocketCoderClient Current = (SocketCoderClient)MemberToRemove[i];
                            if (Current.username != msgCommand.Sender)
                                continue;
                            else
                            {
                                MemberToRemove.Remove(Current);
                                Current.ReadOnlySocket.Shutdown(SocketShutdown.Both);
                                // prevent setup recieve call back for removed client
                                return;
                               // break;
                            }
                        }
                        break;
                    case ClientCommand.msgType.Message:
                        ArrayList Members = Clients[msgCommand.ChatRoomID];
                        for (int i = 0; i < Members.Count; i++)
                        {
                            SocketCoderClient Current = (SocketCoderClient)Members[i];
                            Current.ReadOnlySocket.Send(aryRet);
                        }
                        break;
                    default:
                        break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("OnRecievedData - " + ex.Message);
            }
            //client.Send(msgStream.ToArray());

             /*   foreach (SocketCoderClient clientSend in ClientsList)
            {
                try
                {
                    clientSend.ReadOnlySocket.Send(aryRet);
                }
                catch
                {
                    clientSend.ReadOnlySocket.Close();
                    ClientsList.Remove(client);
                    return;
                }
            }*/
            client.SetupRecieveCallback();
        }