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.
@@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 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.
To bring in the import you can hover over Encoding and hit ctrl .
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.
Hii I followed the steps but used port 8080. The connection cuts off after sending bytes. Please help
Thanks!
Bah! You stopped short of reading the incoming stuff! I needed to know that. 😢
What does the “using” do?
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.
nice. it would be much more deadly if it could accept a url instead of an ip address, or maybe both.
C# is kinda lame it won't let you craft your own tcp packets
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.
@@elevatecyber5031 you can set specific flags in a tcp packet?
@@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
@@MinokawaPH fundamental networking isn't a library, its a core feature of every language
@@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.