In this project, There is client-server architecture model. The server is expected to backup according to the directory provided by the client. Clients can be online after connecting to the server via the same port and IP address, and all changes made on the client side must be reflected on the server side (Add / remove / update). The multi-thread server side should be able to serve more than one client at the same time. All processes are hold in the log file.
This project is an application that runs through the console.
- All the
code
required to get started
- Clone this repo to your local machine using
https://github.com/Emreozgun/TCP-IP-BASIC-DROPBOX-MODEL.git
- Then open the terminal and go to the directory where the file is located.
- Run with make all && ./server [directory] [threadPoolSize] [portnumber] && ./client [dirName] [ip address] [portnumber]
- If you want to clean executable files,you can use make clean
server [directory] [threadPoolSize] [portnumber]
where the directory is the servers specific area for file operations (there shouldn’t be multiple servers running on the same directory in the same computer), threadPoolSize is the maximum number of threads active at a time (meaning maximum number of active connected clients), portnumber is the port server will wait for connection.
The server side is backup the files of the client by mirroring. While the client is connected to the server, modifications done to client’s directory (add, delete or modify file) also be done in the server side. Therefore, the two directories are consistent while the connection is active. The server is able to handle multiple clients at the same time (a multi-threaded internet server). The server is also log the create, delete and update operations of all files in a log file under the corresponding directory reserved for the client.
client [dirName] [ip address] [portnumber]
where dirName is the name of the directory in the computer where client is called, and ip address and portnumber is the connection address and port of the server (ex. 10.1.18.44 18232). The path of the directory identifies each client. When a client that was connected before connects again, it will receive missing files from the server if there is any. The files that were created or modified while the client is offline is detected and copied to the server side after connecting.
I like linux penguins :)
Reach out to me at one of the following places!
- Linkedin at
Emre_Ozgun_linkedin
- Stackoverflow at
Emre_Ozgun_stackoverflow