CppCon 2018: Vinnie Falco “Get rich quick! Using Boost.Beast WebSockets and Networking TS”

  Рет қаралды 56,405

CppCon

CppCon

Күн бұрын

Пікірлер: 57
@SuperFritch42
@SuperFritch42 2 жыл бұрын
This is the best talk I've seen that spanned a lot of concepts in a clear way. 👏👏👏
@srcmake
@srcmake 6 жыл бұрын
Your talk was god-tier dude. The entire presentation was amazing, on every level.
@sarveshkumarnasare1420
@sarveshkumarnasare1420 20 күн бұрын
While taking notes, at 10:52 i think the syntax should be std::array rather than std::array 🤔
@nancyfalco4642
@nancyfalco4642 5 жыл бұрын
Its wonderful to hear the voice of my wonderful Vinnie. My child prodigy and creator of Bear Share. I miss you so m u c h!
@andrelucas8950
@andrelucas8950 Жыл бұрын
That was worth a thousand pages of documentation, thank you!
@rmpowell77
@rmpowell77 5 жыл бұрын
Really great video. So much content that I found myself having to frequently pause and go back to review. Powerfully simple.
@mzimbres
@mzimbres 6 жыл бұрын
Another great talk from Vinnie. With the networking TS and Beast I would not be surprised to see C++ taking some place from Erlang in realtime communication. Thanks to Vinnie for making this library available to us.
@jordan4220
@jordan4220 4 жыл бұрын
That was quite a rich talk and just what I was looking for. I was really confused with the examples online. That transfer of ownership paradigm with the shared from this was very unintuitive to me. I like the JavaScript lessons and how everyone was so amazed at how easily it was to do the client socket in a higher level language.
@alexeiz
@alexeiz 6 жыл бұрын
Damn! Networking in C++ used to be complicated. Now everyone is going to know how to do that in relatively few lines of code.
@thevinn
@thevinn 6 жыл бұрын
Have no fear, we are far from removing the last remaining complexities from C++ :)
@vladyslav007
@vladyslav007 6 жыл бұрын
It's not actually a complicated though. Just try to write something using boost::asio and then imagine that standard C++ asio will be better (you might not feel that much pain when boost requires handlers to be CopyConstructible, but it's a hell of a pain).
@thevinn
@thevinn 6 жыл бұрын
@@vladyslav007 Boost.Asio only requires MoveConstructible handlers now, as of Boost 1.66.
@aryangupta9034
@aryangupta9034 5 жыл бұрын
@@thevinn I wish that were to be true, but boost still requires CopyConstructible: www.boost.org/doc/libs/1_70_0/doc/html/boost_asio/overview/cpp2011/move_handlers.html ("However, handler types are still required to be copy constructible")
@norikazuoshiro6324
@norikazuoshiro6324 5 жыл бұрын
30 seconds deadline for session deletion because i didn't want to use shared pointers. i learned something new today.
@starl1ghtsc2
@starl1ghtsc2 5 жыл бұрын
whut? Could you explain this please
@norikazuoshiro6324
@norikazuoshiro6324 5 жыл бұрын
When i first time used asio, i have a session object that handle 2 sockets (2 strand). If one of the sockets closed, i couldn't immediately free the session since the other socket still using share states in their complete hanlde (run async on other thread). I didn't know how to syn this so i made a deadline timmer to let everything clean up before deletion. It is really bad design, but would be easier if i used share pointers. i'm newbie so still have to learn more.
@CristianMarletta
@CristianMarletta 2 жыл бұрын
Great talk, super clear and Vinnie keeps it always interesting.
@fourscoreand9884
@fourscoreand9884 4 жыл бұрын
Thanks for all your great work, Vinnie.
@jiwang4342
@jiwang4342 2 жыл бұрын
great material! thanks for your great work!
@FabienFabienB
@FabienFabienB 2 жыл бұрын
Amazing presentation. It requires multiple listen to fully grasp the full extent which is really necessary to mast low level websocket in C++. Curious about Beast alternate implementation and how they fare in terms of performance / ease of use.
@starriet
@starriet 10 ай бұрын
around 20:40) I think `while(N--)` should be `while(--N)`, since the intent is making the vector contain N-1 threads, not N threads. Anyway, thanks for the wonderful talk!
@sarveshkumarnasare1420
@sarveshkumarnasare1420 20 күн бұрын
Nope! it's alright mate. Let's take an example where N is 5 now "while(N--){/*code*/}" will run 5 times but "--N" will run 4 times (integer 0 is considered as false). Hope it helps😊👍
@baumstamp5989
@baumstamp5989 4 жыл бұрын
printing money as we speak
@stavb9400
@stavb9400 13 күн бұрын
I had to go through the entire talk and 3 hours on stack overflow to understand how to make this work without exceptions for websocket . More examples showcasing real applications with independent writes and reads would make sense make this library more widespread . Or at least a simple wrapper with default implementations that just work and if someone needs to optimize then he can spend his time into the nitty gritty of executors iocontexts and the whole party of implementation details . In Js in 5 lines u can do the same , we should have this possible in c++ as well
@teras418
@teras418 6 жыл бұрын
**claps** great talk! love your code and libs Vinnie !
@xfreeman86
@xfreeman86 4 жыл бұрын
Why does ConstBufferSequence require CopyConstructible instead of just MoveConstructible? How many coexistent copies does the write method create internally?
@thevinn
@thevinn 4 жыл бұрын
Well, consider an operation X on a buffer sequence which is expressed in terms of two or more calls to operation Y which operates on a subset of the buffer sequence. If this operation X is invoked on a buffer sequence that only supports MoveConstructible, then ownership of the buffer sequence would transfer to the first invocation of operation Y. At this point operation Y could not be invoked again, because operation X no longer has ownership of the buffer sequence (it is in the moved-from state).
@xfreeman86
@xfreeman86 4 жыл бұрын
@@thevinn A ConstBufferSequence is just a pointer and a size. Why can't X construct its own move-only view of the same values (e.g. via the overload `const_buffer buffer(const const_buffer & b)`) to pass to Y? As it is requiring CopyConstructible, it doesn't mind constructing a new ConstBufferSequence.
@juryk666
@juryk666 6 жыл бұрын
Thanks for making this video! So helpful.
@PixelPulse168
@PixelPulse168 6 жыл бұрын
This technology gives me chills.
@immabreakaleg
@immabreakaleg 6 жыл бұрын
as in "I hope I won't ever have to use it cuz these apis with fncs like consume and commit suck ass?" or as in it's awesome?
@immabreakaleg
@immabreakaleg 6 жыл бұрын
spoke too soon, this talk gets better!!
@jaysistar2711
@jaysistar2711 6 жыл бұрын
I would really like a talk about Boost.Beast with the Networking TS and the Coroutines TS. If there isn't one, I think we will all get too comfortable with JavaScript async/await. C++ needs coroutines here to simplify the lifetime of the state, not just the control flow, using an allocator that allocates out of a a std::array in the coroutine frame. It would be nice if someone would make this not-yet-done talk.
@jasonenns5076
@jasonenns5076 3 ай бұрын
Does Boost.Asio not fit the features that you need?
@AYetau
@AYetau 6 жыл бұрын
Could someone please explain to me the reasons of the reoccurring Javascript bashing here at cppcon talks? Or how should it be understood if not bashing? Is it just a popular humorous handling of other languages in general, more like a running gag? But if I should keep my hands away from JavaScript in productive code, for what reasons and what's the better alternative?
@thevinn
@thevinn 6 жыл бұрын
Well, I wouldn't go so far as calling it "bashing" but the level of expertise required to learn and use JavaScript is far lower than that required to learn and use C++. As a consequence, there are many more JavaScript programmers than there are C++ programmers. Correspondingly, there are many more BAD JavaScript programmers than there are bad C++ programmers. JavaScript is also harder to maintain as the size of the program increases. This doesn't mean that large C++ programs are automatically more maintainable, but C++ gives you more tools to keep software entropy down. In particular, the type system in C++ is quite robust. I'm not making a value judgement here, each language has its own strengths and weaknesses. As you can see from watching my talk, JavaScript let me put up a GUI and implement a multi-user chat client very quickly, with a tiny amount of code. JavaScript definitely has its place we just need to make sure that we are using it for the right things. And of course JavaScript made the two authors I profiled in my talk quite rich, so who can really argue against it? :)
@frydac
@frydac 5 жыл бұрын
Also, keep in mind that, quoting bjarne: "There are only two kinds of languages: the ones people complain about and the ones nobody uses." There is also a lot of complaining about C++ out there, and they are, sometimes :) , not wrong.. it is what it is, it's big, it's complicated, there are good parts, there are not so good parts.. but ppl get things up and running in the real world right now (while complaining non-stop about it (referring to some coworkers)). I guess the same can be said for JavaScript
@thevinn
@thevinn 5 жыл бұрын
@@frydac Hah, love it! Bjarne, ever so pragmatic!
@bsuperbrain
@bsuperbrain 2 жыл бұрын
it is 2022 and still no standardized networking in c++
@IllumTheMessage
@IllumTheMessage 6 жыл бұрын
Great talk Vinnie.
@pazdziochowaty
@pazdziochowaty 6 жыл бұрын
I think Qt5 websocket library seems easier to use (doc.qt.io/qt-5/qtwebsockets-simplechat-example.html does something similar to what is presented here). I would prefer it unless there is a strong need that my application has to use pure standard and boost
@Rust_Rust_Rust
@Rust_Rust_Rust 2 жыл бұрын
Nope 🙅🏻 Qt5 is bloated
@llothar68
@llothar68 6 жыл бұрын
The problem is that this is just using the 1970ths old socket API, so it's boring 50 year old stuff. With 40 or 100GBit Network adapters, the Berkley Socket API is just not useable anymore. Once 20 years ago there was talk about 10K program now it's 10M. Do research but we will pull out the whole networking api into user space and assign threads direct to them as handlers. There will be a lot of software changes to make this scale.
@VivekNa
@VivekNa 6 жыл бұрын
Just because something is old doesn't mean it's bad. There's nothing boring about UNIX sockets - it's run the internet and stuff that predated the internet since decades. Even if you did invent something better, were stuck with sockets unless the new thing has a revolutionary benefit. You can build whatever abstractions you want over and above the sockets layer. The fact that agar.io is able to allow so many players, shows the efficiency of the system. This talk was just a demo to illustrate how to go about wrapping the lower level layer into a higher level API without losing efficiency and a primer of how to use asio
@llothar68
@llothar68 6 жыл бұрын
​@@VivekNa Old == Inefficient for modern technology. The current API doesn't scale. Just use google, there are modern attempts. And i hope we get coroutines soon because they are absolutely required if you just have a few tens of nanoseconds for every frame. Like filesystems (i really fucking hate them) we really need to go away from the classic 50 year old unix design. But it's very hard to talk about this to people who are extremely conservative and blind for real world needs and advantages.
@thevinn
@thevinn 6 жыл бұрын
@@llothar68 Coroutines are a notational convenience they do not improve performance relative to callbacks. The Networking TS api scales just fine, plenty of companies are using them with fiber / 100GB backbones with custom drivers.
@videojeroki
@videojeroki 6 жыл бұрын
great presentation ! too bad i don't use websocket stuff ;)
@aaronr.9644
@aaronr.9644 6 жыл бұрын
Great talk.
@zhaoli2984
@zhaoli2984 5 жыл бұрын
Nice, thank you
@kalderify
@kalderify Жыл бұрын
"Every mutable buffer sequence is also a const buffer sequence. So that's that" No wonder c++ is as dead as glam rock.
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
TCP/IP Networking with Boost.Asio
1:33:36
Utah Cpp Programmers
Рет қаралды 12 М.
Back to Basics: Concurrency - Arthur O'Dwyer - CppCon 2020
1:04:28
Evolution of software architecture with the co-creator of UML (Grady Booch)
1:30:43
The Pragmatic Engineer
Рет қаралды 99 М.
CppCon 2016: Jason Turner “Practical Performance Practices"
1:00:29
Microservices are Technical Debt
31:59
NeetCodeIO
Рет қаралды 728 М.
Andrew Kelley   Practical Data Oriented Design (DoD)
46:40
ChimiChanga
Рет қаралды 155 М.
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН