Asp.Net Core WebSockets Vs SignalR. Which should you use? (Full Course)

Поділитися
Вставка
  • Опубліковано 27 лип 2019
  • In this video we build 2 separate chat applications, one using Asp.Net Core WebSockets and the other using SignalR, allowing you to compare approaches and decide on which one works best for you. In both cases we build them with C#, .NET Core and JavaScript. You’ll also learn about:
    - .NET Core Request Pipeline
    - Request Delegates
    - Asynchronous Programming in .NET (Async / Await)
    - Introduction to Dependency Injection
    - My Book: www.apress.com/gp/book/978148...
    A companion article, (including all links to all the mentioned references and articles), can be found at: dotnetplaybook.com/
    GEAR
    ----
    I created this video using the following gear, (which I paid for myself!):
    - My Camera: amzn.to/2W4ULRc
    - Wide Angle Lens: amzn.to/2FfEDGK
    - USB3 Docking Station: amzn.to/2T7T2IY
    - Memory Cards:amzn.to/2TKVLxf
    - Lavalier Mic: amzn.to/2FcfdbM
    - Video Editing: amzn.to/2FhKL1j
    - Productivity: amzn.to/2Ckywza
    Note: I may receive a small commission if you choose to buy something from Amazon after clicking any of the links above.
  • Наука та технологія

КОМЕНТАРІ • 150

  • @automatic241
    @automatic241 5 років тому +138

    Simply no one does all this for free, thank you for your work

    • @binarythistle
      @binarythistle  5 років тому +36

      No worries, it's my pleasure!

    • @manyayao8103
      @manyayao8103 2 роки тому

      would it be ok to ask you: if you could share the source code ?

  • @giorgilomtadze8600
    @giorgilomtadze8600 2 роки тому +1

    Huge respect, usually I don't comment on any tutorials, but the knowledge of the topic and details is astonishing! Well done lad!

  • @stupiddoeswow
    @stupiddoeswow 4 роки тому +4

    Fantastic video. It's exactly what I was looking for. Watched it start to finish and I learned tons. Thanks so much dude! :)

  • @DRFFredy
    @DRFFredy 3 роки тому +4

    I enjoyed the tutorial and learned a lot. Thank you for sharing your knowledge and for spending all the time needed to make this tutorial (research, live coding and speaking, video editing, etc).
    May the universe bless you Les!!

  • @babanmalhi6168
    @babanmalhi6168 3 роки тому +1

    This video was very very long but it worth watching every second of it. Thank you so much and god bless you! Thank you for taking so many hours from your schedule to teach us all.

  • @chrismcclure4264
    @chrismcclure4264 3 роки тому +24

    How does this not have more views? This is better than pay courses.

    • @elpiruwebmaster
      @elpiruwebmaster 2 роки тому

      The best is it contains more than I expected.

  • @Radwinskee
    @Radwinskee 4 роки тому

    This is an AWESOME tutorial. I love the way you explain each line of code after you manually type it in and the way you explain other concept that was needed in this tutorial like the "Async and Await". I think you would be a really effective and fantastic teacher in a classroom. No offence but you are much much better than my professor in college. Thanks again and please continue helping other coders by your tutorials. - Your follower here in Canada.

  • @watershedmetal2
    @watershedmetal2 4 роки тому +4

    This is the perfect style of teaching. Provides loads of information, all of which is on-topic, never wanders down any rabbit holes bloating the content but also never glosses over anything crucial to the full understanding of the subject. Clearly has a very high level of experience and willing to take the time to share. Thank you so much!

    • @binarythistle
      @binarythistle  4 роки тому +2

      Thanks mate! This was a long one but I wanted to cover everything, (as you say), that was relevant. Thanks so much for taking the time to feedback, much appreciated, Les

    • @MobilTemp
      @MobilTemp 3 роки тому

      Lmao I loved it too. Your comment is just right on bro.

  • @nielsciezkowski5649
    @nielsciezkowski5649 4 роки тому +1

    A long video but worth every minute of my time! Thanks for this enlightening video!!

  • @QuavePL
    @QuavePL 2 роки тому

    I had watched few tutorials about making websocket application in .NET Core but I can't get how it works under until I found your video. Great job!

  • @dpavlovsky
    @dpavlovsky 2 роки тому

    You're a legend man. Thanks for the video. I'm getting into Websockets and SignalR right now and this helps a lot.

  • @GeorgiMarokov
    @GeorgiMarokov 3 роки тому +3

    That was fantastic tutorial! Thanks for that. Keep up with the good work!

  • @flygonfiasco9751
    @flygonfiasco9751 4 роки тому +2

    Love that you didn’t just copy an paste code. Thank you for the tutorial!

  • @Sparklmonkey
    @Sparklmonkey 9 місяців тому +1

    This is the second time I'm following this course. FIrst was about 2 years ago, and now I am refreshing my knowledge and cleaning up my old implementation of SIgnalR.
    I am actually using SignalR for a Unity game, to handle PvP in a card game.
    Really awesome tutorial, easy to follow but contains all the information you need! Top notch!!

    • @richardoteri9746
      @richardoteri9746 5 місяців тому

      same came back to this after 2 plus years! amazing tutorial.

  • @brendaescobar1024
    @brendaescobar1024 2 роки тому

    Es el video mas educativo que encontré hasta ahora, muchísimas gracias por explicar, cuando estas empezando necesitas explicaciones lo mas profundas y complejas posibles, reitero, te lo super agradezco.

  • @pinwanrj
    @pinwanrj 3 роки тому +1

    That's a fantastic job, Jackson. Congrats!!!

  • @umeshhbhat
    @umeshhbhat Рік тому

    Great content. Loved the DI and the configuration part for the middleware.

  • @nickguerra8460
    @nickguerra8460 4 роки тому +1

    Great video Les. Love the style, love the info. Please keep up the good work, it is very much appreciated!!

    • @binarythistle
      @binarythistle  4 роки тому

      Thanks Nick, best wishes from the "land down under"

  • @kimaloshyn4754
    @kimaloshyn4754 2 роки тому

    Incredible material. I really enjoyed every piece of the infomation you presented. Thank you!

  • @tayannepaula
    @tayannepaula 4 роки тому +3

    Thank You Les, your teaching is incredible! Best Regards from Brazil.. Obrigado!

  • @zulhishamtan4308
    @zulhishamtan4308 3 роки тому

    A very prefect tutorial course.
    Awesome work.
    Thank you very much.

  • @ta-cvig
    @ta-cvig Рік тому

    I really needed this! Thanks for sharing Les. You Are Appreciated!!

  • @niall5447
    @niall5447 2 роки тому

    I am 1.5 hours into this, thank you so much for this. Very easy to listen to and making so much sense. After this I might even shout for Scotland in Rugby (Probably not being irish)

  • @Bloodthirst
    @Bloodthirst 4 роки тому +1

    as someone who is kind of new to .NET Core (coming from a Unity3D background) , this is was the best explanation i found of middlewares , just very clear and straight to the point. thnx for the high quality video

    • @binarythistle
      @binarythistle  4 роки тому

      Awesome - thanks for the feedback mate.

  • @pablominjares4490
    @pablominjares4490 2 роки тому

    Material is succinct and delivers on multiple layers. You're a true developer! Thanks for sharing your journey 😃

  • @multylife
    @multylife 2 роки тому +1

    heeello Professor, the content of your course is simply sensational and saved me on a new journey (new job haha) thank you very much! I'm already your fan.
    Saalve Professor, o conteúdo do seu curso é simplesmente sensacional e me salvou numa nova jornada( novo emprego haha) muito obrigado! já sou seu fã.

  • @VAcharya
    @VAcharya 4 роки тому +1

    Awesome stuff!! Thank you very much. Loved it. Keep up your work.

  • @reymarkandog1441
    @reymarkandog1441 4 роки тому

    Great Content man. Everything seems clear now.

  • @diegoforlan2568
    @diegoforlan2568 3 роки тому +2

    my english listening level is very bad. but i am listening this man,even if i don't understand what he says :D

  • @bradrehman7964
    @bradrehman7964 3 роки тому

    Great vids....Wish I had come by them even sooner...really enjoying your content.

  • @jak3f
    @jak3f 3 роки тому

    what an amazing tutorial. Many thanks Les!

  • @eykalgzr
    @eykalgzr 2 роки тому

    This is awesome course man. Thanks!

  • @erokazen
    @erokazen 2 роки тому +1

    You always say 60mins 😂
    Nd u end up with 3 hours
    Thank you so much 🙏🏽🌹

  • @timothyboyd8551
    @timothyboyd8551 2 роки тому

    Regarding letting you know how I received the long coding block of the WebSocketClient.html: I enjoyed following along and typing code after you. I believe this is the first html plus javascript document I have ever typed. I believe it will prove valuable experience for me. thank you.

  • @govindkarthikeyan
    @govindkarthikeyan 3 роки тому

    First thanks for sharing such a valuable content for free, next thanks for spending more than 3 hours of your valuable time and share all your knowledge with everyone. I never saw any paid content which explains clearly like you explained here. Thanks again.

  • @Krepenzis
    @Krepenzis 2 роки тому

    Greeting from Scotland! 😁
    Really good tutorial and great job, thanks! 👍👏

  • @blip-hn6is
    @blip-hn6is 3 роки тому

    thanks bro it helped me so much. its really hard upgrading systems that old signalr .net framework to .net core

  • @husseinbeygi754
    @husseinbeygi754 3 роки тому

    So much knowledge in 3h.thank you...

  • @FlorentBathily
    @FlorentBathily 3 роки тому

    Realy thank's for your job you help me a lot ! big up from Africa

  • @abdelkrimbournane7332
    @abdelkrimbournane7332 3 роки тому

    Great tutorial, thank you !!

  • @kombuchamp
    @kombuchamp 5 років тому +7

    Thank you for your work!

  • @vahidrashidli5551
    @vahidrashidli5551 2 роки тому

    Thank you! you helped me tremendously

  • @sheikmaideen5351
    @sheikmaideen5351 Рік тому

    Thanks a lot. The tutorial is amazing.

  • @dchennaraidu
    @dchennaraidu 3 роки тому

    Thank you Les!

  • @neoan1
    @neoan1 2 роки тому

    Quiet good saved me a lot of time and effort.

  • @BTimelessC
    @BTimelessC Рік тому

    In the websocket implementation, I changed the Action delegate parameter of the ReceiveMessage method with a Func so I can control when to stop receiving in the while instead of just having while(socket.Status.Open),
    Do you think that my approach makes sense?
    edit: Great video by the way, really appreciated it

  • @mabakoo
    @mabakoo 4 роки тому

    Great tutor.. basics clearly explained. Can you explain signal r with a blazor server app ?

  • @haijiesggu8508
    @haijiesggu8508 Рік тому

    HI Jackson, thanks for your video. do u have article or video about how to scale out the websockets.

  • @user-nn4rv9cy1m
    @user-nn4rv9cy1m 2 роки тому

    very useful
    thank you for your work

  • @Caldaron
    @Caldaron 3 роки тому +1

    Thanks for this amazin tutorial Les, you rellay helped us out here ;-)

  • @amineayachi335
    @amineayachi335 Рік тому

    Thanks Les Jackson youre amazing

  • @Dennis19901
    @Dennis19901 3 роки тому

    Feels like all of the boilerplating that you wrote/have to write for Websockets is already present in SignalR.
    That alone seems like a major benefit, at the very least for small projects/prototyping.

  • @abdelkrimbournane7332
    @abdelkrimbournane7332 3 роки тому

    GONNA BUY YOUR BOOK!!

  • @DJosh-cs5vx
    @DJosh-cs5vx 2 роки тому

    Thanks as always

  • @saschah6399
    @saschah6399 3 роки тому

    Great work. Really good explained. How could I now push something from the Server. So if I want to keep the connections open, do something in a thread. After my work is done. send something to the client.
    I did a singelton of the MiddleWare class, but that does not seam clean.
    Cheers

  • @goncalomenboss
    @goncalomenboss 4 роки тому

    gotta love the sound transitions

  • @mustafacinar9153
    @mustafacinar9153 3 роки тому

    Nice intro, i see you are a man of culture as well.

  • @Mortizul
    @Mortizul 5 років тому +1

    The intro track makes me think of a slowed down version of "Geography 1" by Front 242. I prefer the sped-up version of you writing code to a cut & paste approach.

    • @binarythistle
      @binarythistle  5 років тому +3

      Hey Mortizul ! I'll check out Front 242 - they look right up my street! Yeah I think a musical interlude can work well if the music is ok. Also I quite like showing the mistakes I make, it makes it more real than just copy/pasting correct code. Appreciate the feedback, Cheers, Les

  • @naveenpolasu4670
    @naveenpolasu4670 10 місяців тому

    Really helpful.

  • @everforexcanada5663
    @everforexcanada5663 Рік тому

    wow such a great vid! thank you so much! I have enjoyed every single second of the video and learnt a lot! one humble request, could you make another vid when you free and explain how authentication, security and http session management work in a websocket or singlr web application? say login to a http page, and then do real work with all of the login credentials and session on another websocket server.

  • @DiddleDangle
    @DiddleDangle 4 роки тому

    I actually really like that you did this in straight javascript because I think it's a lot easier to see what's going on.

  • @abdelkrimbournane7332
    @abdelkrimbournane7332 3 роки тому +3

    In a nutshell, why you should use SignalR over Websockets.
    Websockets part : 2h30min
    SignalR part : 50 min.

  • @diegoforlan2568
    @diegoforlan2568 3 роки тому

    intro music is wonderfulll :D

  • @alexandermeeus2554
    @alexandermeeus2554 3 роки тому

    Thanks again, Mr. Jackson.
    Ps: 'Les' means 'Lesson' in dutch :)

  • @fatemehayoubi2020
    @fatemehayoubi2020 2 роки тому

    It was so goooood! But I wish you save the chat in db

  • @LornaKelso
    @LornaKelso 5 років тому +3

    Thanks so much Les

    • @binarythistle
      @binarythistle  5 років тому

      My pleasure hope it was useful!

    • @LornaKelso
      @LornaKelso 3 роки тому

      @@binarythistle I've finally been given the go ahead to start in on this project in work so I started looking at your video. I'm about an hour in, and I'm starting to panic because nothing is making sense as regards my specific requirements! Do you discuss how to create a WebSocket client in C# in this video? Specifically using .NET framework? I am not building the server, I am just connecting to an existing websocket server which provides information from a telecoms provider.

  • @asharnavya
    @asharnavya 3 роки тому

    I am proud that I am a student of yours.... Where you were for the last 8 years...? :)

  • @vivekverma30494
    @vivekverma30494 4 роки тому

    Thank You.

  • @bijaysahoo9619
    @bijaysahoo9619 2 роки тому

    Hey Les! One question. I couldn't figure out in WebSocket part, how the method "InvokeAsync" gets triggered. There is no reference to it.

  • @jakubdedio5421
    @jakubdedio5421 4 роки тому

    Awesome!

  • @kennethgee2004
    @kennethgee2004 2 роки тому

    Well this is two years old now and Microsoft has answered that question for us. It is SignalR as that is what is being used with Blazor

  • @DevOpsHasan
    @DevOpsHasan 2 роки тому

    Please create a video on webRTC with signalR directly use in asp core without node+express+socketIo

  • @nobytes2
    @nobytes2 3 роки тому

    3:07:00 or so there is a SignalR interface, I did a SignalR cdn script import, and SignalR.ConnectionState.Disconnected all the states are there.

  • @sergeyagajanov1597
    @sergeyagajanov1597 3 роки тому

    Do you find SignalR useful when we speak about websocket-only integration between asp and native application like ios (swift) or android (kotlin/java)?
    I would not want to involve some sort of dependency of officially unsupported client-side signalR libraries for swift and java. And which more important would like to save some freedom to migrate websocket backend from asp to other platform, for example written in Golnag.
    For now it seems that client just need to support a little bit specific SignalR protocol json format , but maybe it's possible to customize this format. Or a better choice to give up with SignalR at all and use pure webSocket infrastructure like you provide in you lesson?

  • @dfytq
    @dfytq Рік тому

    You have showed how to communicate with chat hub. But what if I want to reach to the client from my service layer? For example if a user submit a request, after a few seconds I want to reach to him. In the chat hub there is no exposed method that allows to achieve that?

  • @bjamisetti
    @bjamisetti 4 роки тому

    Very Helpful...Thank you very much..(Y)

  • @rosmuhammad5089
    @rosmuhammad5089 Рік тому

    im on minutes 55 now on websocket. i am never this invested in a youtube tutorial before 🤣

  • @russellabraham9208
    @russellabraham9208 4 роки тому

    Thank you

  • @henrygu6149
    @henrygu6149 8 місяців тому

    I would use SignalR. It saves lots lots of work of managing all the connections, when we need to consider of multiple browsers

  • @baqoficial3767
    @baqoficial3767 3 роки тому

    nice code over there excepting JS wich seems to be copied from Microsoft docs example. Anyway I really appreciate your work. I saw already many tutorials of websocket in diffrent programming languages and readed many docs about it but your video is just best like all in one.

  • @sachithwickramaarachchi9695
    @sachithwickramaarachchi9695 3 роки тому

    Great video Sir

  • @rukshanpokharel6841
    @rukshanpokharel6841 4 роки тому

    hello les I really need your help here...can you provide how to do this exact same things in asp .net mvc web api.. this is for .net core and i am doing my project in web api.. if you provide me how to do the signalR in web api it would be a big help for me ..

  • @avimehenwal
    @avimehenwal 4 роки тому +2

    Greetings from Germany XD Excellent video ... very generous. God bless you. I learnt a lot.
    I am working on a realtime app for RIM embedded system, would be using these leant skills for the project

  • @WaterfallEnthusiast43
    @WaterfallEnthusiast43 Рік тому

    I have no idea what any of this is. Came here from an Excel LBO modeling video but this was very interesting.

  • @rockey4474
    @rockey4474 5 років тому +1

    Bro, Thanks to share.

  • @pavolhlavac-pianist7916
    @pavolhlavac-pianist7916 2 роки тому

    perfect!

  • @b1gboss
    @b1gboss 4 роки тому

    Great video. One question, is it possible to create clients for the web socket that are not in a browser? Using .net.

    • @GeorgiMarokov
      @GeorgiMarokov 3 роки тому

      Yes you can. There is a client for .NET which you can find in the docs.

  • @igorr4682
    @igorr4682 Рік тому

    Can you provide the link to the background music ?

  • @nathansimpson6619
    @nathansimpson6619 2 роки тому

    So is it possible for me to develop the websocket code on a seperate server and allow multiple wordpress websites trigger it to give me real time comments, posts and functionality on wordpress sites... using same app to many sites? if so please let me know! :) awesome video - but above my head as i only tamper with html and css for most part.

  • @aldiyarualiyev
    @aldiyarualiyev 4 роки тому

    Thanks a lot! Can i ask question? I wanna create video conference on web rtc. What do you think which technology i have choose? (websockets or signalr) thank you in advance!

  • @kfathi1
    @kfathi1 Рік тому

    very nice

  • @felsonexe9061
    @felsonexe9061 3 роки тому

    Its so a powerfull video

  • @devidkumar1796
    @devidkumar1796 4 дні тому

    That's great

  • @jRQLME
    @jRQLME 3 роки тому

    AMAZING

  • @amirmossapour2278
    @amirmossapour2278 4 роки тому +1

    Thank you for your work! متشکرم

  • @mohammedalmahdialjeafry8155
    @mohammedalmahdialjeafry8155 3 роки тому

    WebSocket connection to 'ws://localhost:5000/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED iam at 45.51 and i get this what is the cause of this error ?thanks for the video

  • @chrisbaker5284
    @chrisbaker5284 2 роки тому

    GetAllSockets() returns a dictionary so would it not be more efficient to do:
    var sock = _manager.GetAllSockets()[guidOutput.ToString()];
    if (sock != null)
    {...}

  • @TheVlad3333
    @TheVlad3333 4 роки тому +1

    thank you

  • @zormax4817
    @zormax4817 Рік тому +1

    At 1:15:10 - Why did you give the size of the byte array as 4096? Why 1024 * 4

    • @opticalmouse2
      @opticalmouse2 Рік тому

      He doesn't know but I'll tell you. You can make it any size you'd like.
      Let's say you make it byte[2] instead of byte[1024 * 4] but when the server receives "Zor Max" only "Zo" is registered 'cause of byte[2].
      If I make it byte[3] the only "Zor" is registered.
      If I make it byte[[5] then only "Zor M" is registered. (5 including the space)
      Get it?

  • @Al-SadmanChowdhury
    @Al-SadmanChowdhury 4 роки тому

    i am having an issue while connocting @45:08 ..my error shows
    return str.toString()
    .replace(/&/g, '&')
    .replace(/"/g, '"')
    .replace(/'/g, ''')
    .replace(//g, '>');
    cannot read property toString..
    can anypne help??

    • @memenchomezov
      @memenchomezov 2 роки тому

      make sure your Program.cs is like this (because in the video he showed only Startup.cs content) :
      using Microsoft.AspNetCore;
      namespace WebSocketServer
      {
      public class Program
      {
      public static void Main(string[] args)
      {
      CreateWebHostBuilder(args).Build().Run();
      }
      public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
      WebHost.CreateDefaultBuilder(args)
      .UseStartup();
      }

      }