https://github.com/manavmehta/tcp-file-sharing
A Client-Server architecture CLI that allows transfer of files hosted on the server to any number of connected clients, making use of TCP protocol for reliable file transfer.
https://github.com/manavmehta/tcp-file-sharing
cli cpp file-sharing socket-programming tcp
Last synced: 2 months ago
JSON representation
A Client-Server architecture CLI that allows transfer of files hosted on the server to any number of connected clients, making use of TCP protocol for reliable file transfer.
- Host: GitHub
- URL: https://github.com/manavmehta/tcp-file-sharing
- Owner: manavmehta
- Created: 2021-05-30T19:36:46.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-10-05T08:37:36.000Z (over 4 years ago)
- Last Synced: 2025-09-05T12:54:55.322Z (10 months ago)
- Topics: cli, cpp, file-sharing, socket-programming, tcp
- Language: C
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TCP File Sharing Application
The application has two primary parts - Client and Server - and the reliable transfer is ensured using TCP with help of socket() API specifying SOCK_STREAM.
## The Client’s flow:
* Checks for validity of arguments - needs server’s ip and port to fire up
* Creates sockfd which controls the flow or the control of the connection
* Connects socket ref by sockfd to server_addr (address and port specified)
* Set up data connection in listenfd descriptor and binds the socket to data_addr port
* Then until user quits, listens to commands, parses it using helpers, and executes them using the respective helper functions
## The Server’s flow:
* Opens a TCP connection and starts listening to incoming connections
* Binds the listening file descriptor to the specified port
* Creates a fork of its process for every incoming connection, closing listenfd for that particular fork
* Receives client’s data and command
* Takes the necessary actions