File server can be
considered as administrative storage of
shared resources in the network so that
other terminals in the network can access to those resources.
Here I am implimenting a
multithreaded concurrent server.Multithreaded means seperate thread for each
client request. One main thread (listen) will continiously run till there are
client requests for the files.We have to create seperate thread to service each
client request.Concurrent means that server can handle many client requests
simultaneously.We also have to impliment mutual exclusion for shared resources.It
means that simultaneous reading is possible but
reading while writing or writing while reading is not possible.
First we must run server code
and then client code. After sucessfully conneted with client , server will
display list of available files , will ask whether client want to read or write
file ? In both cases server will send requested file to client and
apply read/write lock on that file so that consistency must be maintained.In my code ,server is opening
file in read mode , reading it and then send it to client.At client end if client
want to read the file , display that
file on terminal. If client is writing into file then that change must be
reflected into file at server side.For next read request that updated file must
be use.