|
_Madmatt wrote: I'm so sorry, my English isn't that good.
I don't buy this excuse
You still have not answered the question, why is doing it in code better? But no matter, not worth continuing based on below.
_Madmatt wrote: I'm not yet studying c#
Then you absolutely should not have answered in the first place
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: Then you absolutely should not have answered in the first place
You don't give beginners a chance? Ow that's pretty nice...
|
|
|
|
|
Beginners, yes. However, by your own admission you do not even know the language. You can't comment on things you don't know!!
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: you do not even know the language.
I know the language. I've read a book. But I'm still at secundary school, so I've not studied c# yet at high school. I surely know the language, otherwise it would be stupid to wate my time on it...
|
|
|
|
|
|
Very simple... Both, I know c# but I'm not yet studying it at school. Or is that too difficult for you to umderstand?
|
|
|
|
|
I'm still waiting for your explanation.
only two letters away from being an asset
|
|
|
|
|
I'm not online all day long
|
|
|
|
|
Surely you could have just answered his question instead of writing "I'm not online all day long"?
I wouldn't argue further, your logic isn't correct, and you might want to reread those books of yours.
|
|
|
|
|
I don't know if you can read, but I've already answered... Read the whole topic before you say stupid things like that.
EDIT: What I said was just a suggestion about how he COULD do it. I've ABSOLUTELY NOT said "this is the best solution". It's the solution how I should do it with my skills and my understoodings about his issues. But if there are better solutions, no problem for me! I have still to learn, but it's not needed to slap me down. Everybody here has ever started with something where there were better solutions for? Or was you a pro from the first day on?
Last but not least a quote from the rules: "Let's work to help developers, not make them feel stupid.."
modified on Thursday, October 29, 2009 1:15 PM
|
|
|
|
|
Funny, I don't see that in the rules[^].
Plus, I'm not the one who looks stupid here.
And you did say it was the easiest method, and you where asked how and ignored it. If anything, you proved your own stupidity, not mine.
|
|
|
|
|
Are you blind???
Apologies for the shouting but this is important.
When answering a question please:
1.Read the question carefully
2.Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
3.If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
4.If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid..
|
|
|
|
|
Again, you never asked the question, so that really doesn't apply to you. If someone asks a question, and another gives an answer that is wrong, or clearly not what is desired, then a 'slap-down' is necessary. You didn't ask for the help, so there is no help for you given. I'm not making you feel stupid either, I think you are accomplishing that on your own.
|
|
|
|
|
Again, I've replied, but my answer was wrong. Okay, I really accept it...
I've answered wrong.
I've answered wrong.
I've answered wrong.
I've answered wrong.
I've answered wrong.
I'm soooooooo sorry. Man, everyone has to learn...
Okay, I said it was the easiest method to do it, but that was following my skills. I've already said I accept another solution. But no, again someone has to start a discussion...
|
|
|
|
|
Struggling to adapt a C++ pattern to C#. How do I get a WaitHandle from an IntPtr, which is the underlying socket handle to use in the socket thread as outlined below? I know there are Aysnc socket varieties but I'm keen to reuse this if at all possible. *** indicates the problem area in code
Thx++
Jerry
//
AutoResetEvent evtHalt = new AutoResetEvent;
//
Socket socket = new Socket(...);
//
WaitHandle handles = new WaitHandle(2);
// set up handles
handles[0] = evtHalt;
// *** Nope *** conversion problems -
handles[1] = socket.Handle;
//
while (true)
{
Int32 ret = WaitHandle.WaitAny(handles);
if (ret == 0)
{
// cancelled as evtHalt was signalled
break;
}
else if (ret == 1)
{
// socket signalled ... do something
}
}
|
|
|
|
|
Why don't you want to use the built-in .NET socket stuff? It's so easy it's downright sinful.
We have a proprietary client/server protocol and a diagnostic tracing facility built on top of TCP/IP sockets. The original code, written in C++, probably has close to a man-year of time on it. I replicated both of them in C# in a couple of weeks.
|
|
|
|
|
Sometimes you want to wait for other things than socket handles. It's common to have EventWaitHandles for signalling conditions to threads. If a thread needs to monitor both sockets and events, then one must find a way to do it the "C++ way". Still looking.
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
Hello all!This is my first post here.
I'm comp.engineering student making a project for company having about 1600 PCs, my task in this software is to collect client PC hardware info and then send it to server,compare ,then to database.
I have already made a console application which extracts hardware info through c# . Now I'm making a GUI based app which would be running on server.
Well I'm thinking of asynchronous sockets for accepting incoming connections would that be OK ?
Also how should i enclose the info from client and send it to server where it is compared to data from SQL server and then committed if relevant . Is XML used for this purpose ?
And yeah also the company people say that need a feature on server that would allow the server to pick this hardware info from any client(s) at that particular instant . Would that require a listener on client side as well ? as i plan to disconnect client as soon it sends the relevant data ?
I'm sorry for my noobish questions as I'm new to this type of software as i have been bit more on hardware side Thanks in advance !
*EDIT* i forgot important thing! and that is the software would not be connected to internet in anycase! whole thing is on the network
modified on Monday, October 26, 2009 3:16 PM
|
|
|
|
|
Well, there are many ways you could do the job.
Using sockets directly or using Web Services.
Web Services will do the job for you and, internally, they use XML. If you use the sockets directly you will need to build the message, so you can build it in XML, or you can use the BinaryFormatter (my preferred one).
The biggest problem is that "need a feature on server that would allow the server to pick this hardware info from any client(s) at that particular instant". To do that you will really need to keep your clients connected.
|
|
|
|
|
Thanks for your fast reply!
The software would not be connected to web at all . so in that case what is better ? sockets (i have programmed them before ,so it won't be a big problem i guess) ? XML ? Binary (Why do you prefer it ) ?
How much network bandwidth would 1200-1600 TCP/IP client programs connected would cost ?
|
|
|
|
|
Well, using sockets you will still need to use binary/xml or other format.
I usually prefer BinaryFormatter (binary data) as it is smaller and generates less traffic. But, about the cost of 1200 to 1600 programs connected I really don't know the information.
But, if they don't send information all at the same time, I think it will not be a problem at all.
|
|
|
|
|
What kind of hardware info? Most such info doesn't change often, and not while the computer is running. How about a small program that gathers and sends the information at system startup? I would likely write the server side with WCF (mainly because I'm just learning it now).
Munis-q wrote: pick this hardware info from any client(s) at that particular instant
I don't see why, unless it should know about USB devices and such.
|
|
|
|
|
Thanks for your reply
Hardware info like Processor ,RAM , Hard-disk and others , i have already made the program using C# and relevant classes . Yes I'm also thinking to make this program run on the start-up
Yes the company wants to detect the removable USBs as well! so can you tell me how much would bandwidth 1200-1600 inactive TCP/IP connections would cost? its the only way to keep them connected all the time i guess
|
|
|
|
|
Munis-q wrote: detect the removable USBs
Have the client send an update when a device is attached? (I don't know how, so don't ask.)
Munis-q wrote: keep them connected all the time
I wouldn't do it that way.
Perhaps, along with the data sent at system startup, send the IP address so the server can connect when it wants.
|
|
|
|
|
PIEBALDconsult wrote: Munis-q wrote:
keep them connected all the time
I wouldn't do it that way.
Perhaps, along with the data sent at system startup, send the IP address so the server can connect when it wants.
Yes I'm sending the IP address of client on startup as well,that means i should put a listener on client as well ? or keep client connected (1200-1600 connections with server) ?
|
|
|
|