Boost logo

Boost :

From: Farbod Ahmadian (farbodahmadian2014_at_[hidden])
Date: 2021-06-01 06:56:15


Hi everyone,
I was learning Boost.Asio recently and to learn by doing a project, I
decided to write a simple file transfer. So I wrote an *Async TCP Server*
and a *Sync TCP Client; *you can use a client to send any kind of file to
the server. This is how it works:
1) Clients connect to the server.
2) Clients send the file name to the server.
3) If everything is okay, the server will return an "OK" to that client and
wait for that client to send the file.
4) If the client received "OK", it'll send the file.
5) If everything goes well, the file is received by server and the
connection will be closed.
I will attach the source codes in this email.
So here are my questions:

1) Would you mind please review my code and say the problems? I'm a newbie
in Asio ;)

2) How to make my client and server talk with a special protocol? Let's say
HTTP. (If a socket server understands HTTP, will it be a web server?
something like Nginx and Apache.)

3) What is the next step? How can I improve this? What should I learn/do
next? Anything is kindly appreciated :)

With best regards,
Farbod





Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk