A simple FTP server implement by C.
- File Transfer Protocol
- Working in the application layer of the TCP/IP protocol family
- FTP will establish two connections, separate the command from the data
- Transfer file model
- PORT: client -> PORT -> server, port > 1024
- PASV: client -> PASV -> server, port < 1024
- Launch FTP
- Establish control connection
- Establish a data connection and transfer files
- Close FTP
- Socket Client
- use socket() to create a Socket
- use connect() to connect server
- use write() and read() to communicate with each other
- use close() to close Socket
- Socket Server
- use socket() to create a Socket
- use bind() to bind Socket
- use listen() to listen Socket
- use accept() to recieve request
- use write() and read() to communicate with each other
- use close() to close Socket
.
├── README.md
├── base
│ ├── to_base.c
│ └── to_base.h
├── bin
│ ├── toc
│ └── tos
├── client
│ ├── makefile
│ ├── to_client.c
│ └── to_client.h
├── pic
│ ├── snapshot.png
│ └── structure.png
└── server
├── auth.txt
├── makefile
├── tmp.txt
├── to_server.c
└── to_server.h
// build
$ git clone https://github.com/i0Ek3/TinyOne
$ cd TinyOne
$ cd client ; make
$ cd server ; make
// run
$ ./tos port
$ ./toc ip port
or run toc and tos directly under /bin.
// login
username: admin username: admin
password: admin password:
//commands
list or ls
get or download
put or upload
quit or q
- Execute tos and toc under /bin will appear "No such file or directory" error, cause of server cannot locate auth.txt.
- More commands support
- Breakpoint resume
- Server-side synchronization display