Building a TCP Client in C#

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

КОМЕНТАРІ •

  • @cryptoeric24
    @cryptoeric24 Рік тому +2

    To bring in the import you can hover over Encoding and hit ctrl .

  • @shavais33
    @shavais33 6 місяців тому

    Hey, great post, thanks for putting it up. A few questions:
    What happens if Connect fails without throwing and you need to retry?
    How do you know it failed and how do you get the error message?
    The docs I'm reading say you need to call EndConnect before using the connection.. is only for ConnectAsync?
    What if Connect hangs for a long time before failing? Is there a way to set a timeout that it will actually honor?
    What if it fails to honor the timeout, how can you kill it in a way that lets you retry after a few seconds?
    I need my client to repeatedly retry if/while the server is down, and I'm having trouble with Connect and ConnectAsync. They don't honor timeouts, they don't pay attention to cancel token sources being cancelled, they just hang.

  • @mduduzimdu6160
    @mduduzimdu6160 7 місяців тому

    Hii I followed the steps but used port 8080. The connection cuts off after sending bytes. Please help

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

    Thanks!

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

    Bah! You stopped short of reading the incoming stuff! I needed to know that. 😢

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

    What does the “using” do?

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

      It's import statement. I basically allows me to use code that someone else already wrote in my program, so that I don't have to reinvent the wheel.

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

    nice. it would be much more deadly if it could accept a url instead of an ip address, or maybe both.

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

    C# is kinda lame it won't let you craft your own tcp packets

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

      You can. That's what the library I was using does. But you can always write the code yourself. Since it's such a standard library, I didn't bother.

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

      @@elevatecyber5031 you can set specific flags in a tcp packet?

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

      @@epotnwarlock Why would you even think it's a C# constraint? It's like saying C and C++ can't do stuff because a "SPECIFIC" library constraints you lol

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

      @@MinokawaPH fundamental networking isn't a library, its a core feature of every language

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

      ​@@epotnwarlock Do you even understand what you're saying? A "core feature" of a programming language is defined by its data types, syntax, and its memory control, and its functions.
      Isn't a library my ass. In C and C++, you use the standard library, would it be C and C++ without the standard library? No, because C is defined by its syntax, and its procedural programming. C++ on the otherhand defined by its syntax and its object-oriented programming. In C# they're called modules, and like the "standard library" of C and C++, they were DEVELOPED USING THE SAME LANGUAGE, most of which are open source.
      A goddamn "core feature" of the language is defined by its ability to be translated to machine language.