Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

VK internship assignment, server and client for file transfer

Notifications You must be signed in to change notification settings

sw1tcherrr/Client-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

2 Commits

Repository files navigation

Client-Server

VK internship assignment

Simple server for receiving files from multiple clients and client for sending files

Features

  • pure C11
  • multithreading with pthreads for receiving multiple files in parallel
  • the fastest way of IO multiplexing - using epoll
  • memory-mapped file IO to omit allocation of buffers
  • comprehensible error messages

Usage

Server:

Server [port] [saving_dir]

Default port and directory for files are 1026 and /tmp (can be reconfigured)

Client:

Client <address:port> <path_to_file> [name_on_server]

Default name_on_server is same as the original filename

Configuration

The following constants can be set in server_conf.h before compilation:

  • BACKLOG - queue size for accepting connections, other ones likely to be rejected
  • MAX_EVENTS - maximum number of file descriptors returned by epoll_wait
  • TIMEOUT - epoll_wait timeout
  • NUM_THREADS - number of additional threads besides main
  • 'DEFAULT_PORT'
  • 'DEFAULT_PATH'

Compilation

Via cmake

Tested with modern gcc, language standard is C11

About

VK internship assignment, server and client for file transfer

Topics

Resources

Stars

Watchers

Forks

AltStyle によって変換されたページ (->オリジナル) /