Re: Java
From: Stefan Schulz (terra_at_spacetime.de)
Date: 09/23/04
- Previous message: Stuart Leonard: "Re: IllegalArgumentException"
- In reply to: Ted: "Re: Java"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 23 Sep 2004 20:50:46 +0200
On 23 Sep 2004 09:59:29 -0700, Ted <johnston_58@hotmail.com> wrote:
> Hi andreas,
>
> Thanks again for the tips.
>
> I have now got my server & client running.
> The server runs from the console ( might change this to a gui ) and
> the client runs from a gui. The server accepts multiple connections.
As andreas said, i would suggest keeping the server simple and
background-only. Configuration can happen via file or privileged users.
> I now want to setup a user manager of some kind which will keep track
> of currently logged on users and when they logoff and also display
> their names/id's beside their messages. I'm not too sure how to go
> about this yet, any idea's?
Sounds like a classic scenario for a Singleton to me. The Singleton would
serve as a "connection registry" to which each connection adds itself on
creation, and updates itself whenever something significant happens. Just
be sure to unregister each connection once it dies. (the finally statement
can be very helpful for such cleanup duties!)
-- Whom the gods wish to destroy they first call promising.
- Previous message: Stuart Leonard: "Re: IllegalArgumentException"
- In reply to: Ted: "Re: Java"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|