|
None of the information in your post is correct as far as using a socket class is concerned and applies only to writing your own TCP/IP stack.
|
|
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: See Page 45[^]
I suggest that you make it more explicit how you think I am wrong.
Or perhaps you could provide a code sample of a listening socket that will detect that the other end is gone when the power plug is pulled on it.
|
|
|
|
|
I suggest you read the documentation for Windows Sockets and the RFC and use them as guides instead of Google searches yielding results that are questions and answers from non-definitive sources. When you post an answer as an Authority you have some responsibility for accuracy. Using TCP/IP and then manually sending keep alive messages is a waste of the protocol.
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: I suggest you read the documentation for Windows Sockets and the RFC and use them as guides instead of Google searches yielding results that are questions and answers from non-definitive sources. When you post an answer as an Authority you have some responsibility for accuracy.
You are incorrect in the intent of my posting.
I know how sockets work having worked with them in C#, Java and C++.
I was citing references to back up what I was saying rather than just restating what I said already - which is what you are doing. Feel free to provide some specific references to make your point. Or cite something specific from the RFC.
I have in fact read the RFC and the C# documentation.
Again...please provide a specific comment on exactly how you think all or part of my response was incorrect.
Ennis Ray Lynch, Jr. wrote: Using TCP/IP and then manually sending keep alive messages is a waste of the protocol.
This statement indicates that you do not know how TCP/IP works.
Again feel free to provide code and a specific scenario that allows a listener to detect when the other end is terminated by a pulled plug. Feel free to provide the code in C#, C++, Java or even Perl.
Although I suppose it is possible that you did not understand why I was suggesting a keep alive. Perhaps that is where your confusion lies.
|
|
|
|
|
prasadbuddhika wrote: while (soc.Connected)
I doubt that is going to serve the purpose that you think it is.
That doesn't validate the connection. All it tells you is that at some time in the past that it worked.
The following are probably the general run time conditions that one faces with sockets.
1. It fails to connect at all. Reasons: Wrong address, port, firewall rules or the server is down.
2. It runs
3. The server disconnects gracefully. Receive() will return zero.
4. The server takes too long. Reason: Server is locked up.
5. The server never responds. Reasons: Someone kicked out the power plug or the firewall dropped the connection.
Notice that in 4/5 no exception occurs. You can get an exception to occur by setting a time out value. That tells you that it hasn't sent data but not why.
|
|
|
|
|
Hi all
how to do function like Console.write() but without using Console.write() and with different name.
I want to say how to create a print function without using Console.write() and name it as you like.
I hear that i can do it by overloading or overriding or anything else .. i don't know.
Thank's
-*-*-*-*-*-*-*-*-*
To Be Or Not To Be
(KARFER)
-*-*-*-*-*-*-*-*-*
modified on Tuesday, February 1, 2011 11:50 AM
|
|
|
|
|
So, you want to write a new method that does exactly the same as the old method. Is that what you're saying?
You could always open up the Console class in Reflector and see what Write (and WriteLine) is doing, and use that as the basis of your code.
|
|
|
|
|
Thank's for reply
but i want to say how to make new method like Console.write by overloading without using Console.write.
-*-*-*-*-*-*-*-*-*
To Be Or Not To Be
(KARFER)
-*-*-*-*-*-*-*-*-*
|
|
|
|
|
I already told you how to do it. Open Console.Write up and have a look at how it does it.
|
|
|
|
|
Don't repeat your question. Remove the one above before some replies to it
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
are you wanting to output to the console?
"If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
|
|
|
|
|
KARFER wrote: I want to say how to create a print function without using Console.write() and name it as you like.
In what language would you want that, C, C# or C++?
KARFER wrote: I hear that i can do it by overloading or overriding or anything else .. i don't know.
Well, you can create methods and name 'em however you want, and they can do whatever you want. Problem is often describing what one wants. Try giving a more detailed example on what you're trying to accomplish
I are Troll
|
|
|
|
|
Eddy Vluggen wrote: In what language would you want that, C, C# or C++?
I feel obliged to draw your attention to the Forum name, Eddy...
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Marcus Kramer wrote: I feel obliged to draw your attention to the Forum name, Eddy
This isn't my forum, it's the C# forum
He's cross-posting, making me wonder what kind of textbook he's reading to come up with a question like this
|
|
|
|
|
We can only wish he would start studying a book rather than ask random questions.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Eddy Vluggen wrote: In what language would you want that, C, C# or C++?
You forgot Visual Basic and PHP.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|
|
Henry Minute wrote: You forgot Visual Basic and PHP
Why, did he also crosspost in the interpreter-fora?
I are Troll
|
|
|
|
|
|
I have x86 and x64 builds of the class library. It is not possible to have Any CPU build since it depends on unsafe builds of the native dll which is also in x86 and x64 builds.
How can I add those 2 to the application project references?
The references is global for any configuration.
The same question is related to debug and release builds.
The other bug even I added x86 file to references x64 is always copied with application exe.
There are no such problems if you add class library project to solution with application though
Чесноков
|
|
|
|
|
You can't add them both. What you could do, is deploy them separately through a custom installation event as the only time it should make a difference is when the application is installed.
|
|
|
|
|
What Pete said. So long as they both have the same interface, you may also want to look into IoC
Architecture is extensible, code is minimal.
|
|
|
|
|
No, I've found a solution to correct .csproj file manually
<Reference Include="MyLibrary, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>libs\$(Platform)\MyLibrary.dll</HintPath>
</Reference>
Чесноков
|
|
|
|
|
The real problem isn't clear.
Some some other possibilities that might be related to the real problem(s).
- Load the library dynamically.
- Create a build event which copies the library based on the type of build requested.
|
|
|
|