– This thread would be a deamon thread. It will authenticate client
passwords and usernames. Once clients have been authenticate, their
information will be stored in the Data Structures. That data is shared by
various components in the engine.The information passed should include the username, login time and
a reference to the client socket (that reference will be used by the
– This can be a relational database or it can just be a file such as
the linux /etc/passwd file. But the /etc/passwd file itself cannot be used
because it can be very unsafe due to the fact that some hacker might be
able to listen in the connection and get the password. That means that the
hacker will obtain the linux password because it is the same as the Server
Structures- Structures such as Lists, trees, or HashTables can be
used. These classes may contain search and sorting algorithms. The
information in these Structures should include the username, login time
and a reference to the clients’ sockets. It may also include the files
checked out or locked by a particular client, etc.
This is a thread (or threads) that is constantly checking sockets queues
for requests issued by clients. If a request is made, the Listener wakes
up one of the sleeping threads in the thread pool to handle the request.
Pool – Keeps threads sleeping if a client is not using them.This is good for performace.
API – This api is the protocol (rules
determining the format and transmission of data) for communicating to the
Server. Each client that anyone creates should use this protocol. Any
connection to the server attempted without using the Client api will be
denied by the client authenticator. To accomplish this, we may use
encryption and/or agreement protocols.
The engine will contain the main functionalities. It will be able to
compare files for clients, merge files, lock files, retrieve and update
files from disk, create new files, delete files, etc. The result of the
operations of the engine will be passed to the particular thread of the
thread pool that asked for it.
Remember that this is not a finished design and it is not
well thought out. I did it in about 15 minutes. I just want your comments.
There are other issues that need to be resolved such as: Should we have a
Server API? There are issues that I myself haven’t put much thought to such as:
How should the listener check for every client request at the same time, etc
Note: This is a starting design. Features can be modified,
removed, or added. Just say what you don’t like or like and how it can be
improved.I am not married to this
so just say if you have a different one and we shall discuss it. Please comment
on this design. Send your comments to email@example.com