Skip to content

gistrec/File-Broadcaster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File-Broadcaster

Build status Code quality Release Code quality License

UDP File sender and receiver
Can use broadcast address to send file on all computers in LAN

Features

  • Send file to one or all computers in LAN
  • Reliability of data transmission
  • Server timeout detection
  • Change MTU

Overview

Download

Clone the source repository from Github.

  • On the command line, enter:

    git clone https://github.com/gistrec/File-Broadcaster.git
    git submodule init
    git submodule update --recursive --remote
    
  • You can probably use Github for Windows or Github for Mac instead of the command line, however these aren't tested/supported and we only use the command line for development. Use this link to download the command line version.

Requirements

  • Windows:
    • Visual Studio 2015 or 2017
  • Linux:
    • g++
    • pthread
    • arpa

Installation

  • Windows
    • Open FileBroadcaster.sln via Visual Studio
    • Build project
  • Linux
    • Open a terminal/console/command prompt, change to the directory where you cloned project, and type:
      make all
      

Script Parameters

Parameter Default Description
p, port 33333 Sender and receiver port
f, filename none Transmitted and received file
t, type receiver receiver or sender
ttl 15 Seconds to wait cliend requests or sender responses
mtu 1500 MTU packet size
broadcast 255.255.255.255 Broadcast address. Can use to unicast.

Packets Specification

Packets structure alt text

Script Specification

  1. Sender send NEW_PACKET packet to broadcast (or unicast) address
  2. Sender send all parts of file via TRANSFER packet
  3. If any pacckets were lost, receiver ask them sending RESEND packet to broadcast (or unicast) address
  4. Sender wait RESEND packets or wait TTL and turns off
  5. Receiver ask all lost parts, until the whole file is no downloaded or wait TTL and turns off