3. Writing a Simple TCP Echo Server | Redis Internals

Поділитися
Вставка
  • Опубліковано 22 гру 2024

КОМЕНТАРІ •

  • @ramavtarrathore6295
    @ramavtarrathore6295 2 роки тому +2

    it's great explanation about tcp connection , single and multi threaded & redis cli client communication

  • @nehagour6928
    @nehagour6928 2 роки тому +2

    Arpit, thanks for the awesome videos!! Such an insightful explanation
    Can't wait for the next one

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

      Hey Neha,
      these videos are part of my Redis internals course. More details arpitbhayani.me/redis-internals/

  • @kaivalya1989
    @kaivalya1989 2 роки тому +6

    This is amazing. Got me excited to learn advanced Go. I have always been a JVM guy 😀

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

      Sounds too much similar

    • @starlord7526
      @starlord7526 9 місяців тому

      yo dude, you can recommend a starting point tolearn Go? any resource or something@@Md_sadiq_Md

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

    Nice 👍..series...love redis

  • @groku0112
    @groku0112 10 днів тому

    which book/resource is best to learn golang for beginners and good at it, espically for a person coming from java background?

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

    Hey Arpit, in this single threaded sync web server, when a new client tries to connect and fires a bunch of commands (while some other client is already connected to the server via the socket), is there any configurable limit, as to how many bytes of commands can be buffered in the socket, which the other client is trying to send?
    Example: You showed at 12:18, that the client pushed a command Arpit and as soon as it got connected, the server printed this. What if this client sent huge GBs of commands? Would the socket connection give some memory buffer error theoritically?

    • @nikhilsrivastava9120
      @nikhilsrivastava9120 2 роки тому +2

      Just read online, that both client and server maintain a standard socket receive buffer and keep exchanging it's size as well during packet exchanges. That curbs how many bytes to be sent over the TCP socket connection.

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

    Hey, In the inner for loop,why are you breaking only on graceful end to the connection. Shouldn't you break from the for loop irrespective of whether the connection broke gracefully or not?

  • @spbirhade
    @spbirhade 2 місяці тому

    Do you teach GoLang?

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

    Awesome 😍

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

    Awesome Explanation Arpit :)

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

    Why have you not used init() function in main for setting up flags and all

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

    How did you learn go lang ? What made you learn go lang ?

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

      We all adopted it to build Microservices back in 2016.
      The performance is really solid. Plus strongly typed. Plus lean GC. Plus low-level APIs.

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

      @@AsliEngineering thank you ..

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

    hey bhaiya great video . also if you don't mind can you please tell me your vs code theme 😅

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

    Can i ask why using read(buff[:]) and not read(buff)? buff is a slice here, right?

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

      Buf is an array and not a slice.

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

      Thanks Arpit for the response. However i think based on the declaration, []byte lools like a slice declaration.
      Can you please reiterate? I tried testing on playground with reflect and it returned true for slice, not array, I may be missing something here but can you check again? Thanks.
      (youtube isnt allowing to post link to the playground)

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

      // You can edit this code!
      // Click here and start typing.
      package main
      import (
      "fmt"
      "reflect"
      )
      func checkType(v interface{}) {
      switch reflect.TypeOf(v).Kind() {
      case reflect.Slice:
      fmt.Println("It's a slice")
      case reflect.Array:
      fmt.Println("It's an array")
      default:
      fmt.Println("It's something else")
      }
      }
      func main() {
      var buff []byte = make([]byte, 512)
      checkType(buff)
      }
      this was my playground code.

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

    Very nice ! Single threaded is best for security and its intelligient designing. Keeping multiple threads open to accept concurrent connections ,even though clients are limited, is not an intelligent programming.