Files
2026-02-22 22:23:05 +01:00

67 lines
2.1 KiB
Markdown

# DirectoryScanSender
`DirectoryScanSender` is a .NET application that scans a directory recursively and sends eligible files to a TCP server using a simple delimiter-based protocol.
It is the sender counterpart to [`DirectoryScanReceiver`](../DirectoryScanReceiver), and both projects can work together out of the box with the current default settings.
## Companion Project
- Receiver counterpart: [`DirectoryScanReceiver`](../DirectoryScanReceiver)
- Shared default TCP port: `7156`
## Shared Protocol
Both projects use the same message format:
```text
<path>|<length>|<content>\r\n\r\n
```
- `path`: file path string sent by the sender
- `length`: declared payload length
- `content`: payload content
Multiple messages can be sent over the same TCP connection, each terminated by `\r\n\r\n`.
## Features
- Recursively scans directories
- Sends files over a single TCP connection
- Skips files larger than `100000` bytes
- Continues running even if individual files fail to read or send
- Uses parallel directory traversal
## Default Behavior
- Target directory: the current user's `Documents` folder
- Connection target: host `localhost`, port `7156`
- File size limit: files smaller than `100000` bytes
## Requirements
- .NET SDK with support for `net10.0`
- Network access to the configured TCP server
## Build and Run
From the repository root:
```bash
dotnet build
dotnet run --project DirectoryScanSender
```
## Compatibility Notes
- The sender is intended to be used with [`DirectoryScanReceiver`](../DirectoryScanReceiver) or another receiver that follows the same message format.
- The current defaults (`localhost:7156`) match the local `DirectoryScanReceiver` project.
- The transfer uses plain TCP and does not include authentication or encryption.
- Console output is used for basic status and error messages.
- Configuration values (host, port, scan path) are defined in `DirectoryScanSender/Program.cs`.
## License and Disclaimer
This project may be used, copied, modified, and shared freely.
It is provided `as is`, without warranty of any kind. The author is not liable for any damages or losses resulting from its use.