jameskokoska / NetworksFileTransfer

📶 A simple client and server implementation that transfers a file across a socket

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Networks File Transfer

The goal of this project is to use UNIX sockets to create a server and client program connection that can transfer any type of file (binary file) across a local network.

Usage

  1. Compile the respective programs. For e.g., using gcc:
    gcc deliver.c -lpthread -o deliver and gcc server.c -lpthread -o server
  2. Get the current local IP . For e.g., using curl:
    curl ifconfig.me
  3. Run the compiled deliver and server programs on the same network
    Use the following syntax to run the programs: deliver <local IP/server address> <port number> and server <port number>
  4. Use the following command in the running instance of deliver : ftp <filename>
  5. The server will receive the file from the sent packets and create a new exact copy of the sent file by combining the sent packets. The new file will be named new<filename>

Features

  • Uses a packet format and acknowledgement implementation
  • Packets are sent as total_fragments:current_fragment:total_size:filename:filedata
  • The file is fragmented if above the max fragment size and sent and split and reassembled at the server accordingly
  • Client program reads data from the specified file and sends it to the server using the chosen UDP socket
  • Server program reads the file name, creates a corresponding file stream and reads data from the packets to write to the file stream

About

📶 A simple client and server implementation that transfers a file across a socket


Languages

Language:C 100.0%