KO
|
EN
gitlite — search
Search
#javascript
#python
#hacktoberfest
#react
#ai
#typescript
#llm
#go
#golang
#android
#machine-learning
#rust
#deep-learning
#linux
directShare
★ 13
Open GitHub ↗
Tiny P2P File Sharing in C#
Download README (.md)
Explore Similar Repositories
CXCarousel
:
一个方便的滚播图控件
sqrtOram
:
No description available.
hydra
:
A Scale Testing infra using Mesos and marathon
atpg
:
An automatic test pattern generation (ATPG) and fault simulation system.
TextViewDemo
:
安卓快速实现关键字变色,搜索字变红,点击字体打电话,textview斜体,电商价格删除线,绿色下划线,图片(表情,图文混排) textview超链接跳转
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
directShare
?
Download (.md)
# directShare Tiny P2P File Sharing in C# ## How it Works DirectShare works as a client server linking through a network stream to send data. The server UI exists as a command line where files can be sent to different clients which connect to it. When a file is sent to the client by the server it first writes the amount of bytes as a string to the stream. The client recieves this number and throws an event asking the user if they want to accept the file, if so it reads that amount of bytes from the stream and saves them to disk. The pros of this system are that everything from sending to recieving to saving operates on a stream, meaning that if you are sending large files at no time will the entire file be hogging up RAM. ## The Protocol DirectShare protocol is very simple. When the server sends the length of the file to the client it writes this to the stream: ``` [BYTE_SIZE] + "\r\n" ``` From there it writes each byte of the file to the stream. ## Sample Run: Server: ``` $ ./DirectShare.exe -s 127.0.0.1 1337 > Client connected from 127.0.0.1. Check client list with list command > send 0 /home/reagan/Hassium/src/Hassium/bin/Debug/Hassium.exe > ``` Client: ``` $ ./DirectShare.exe -c 127.0.0.1 1337 Data of size 305664 recieved! Accept? y/n y Enter path to save location: /home/reagan/has.exe ```