Question Establish a TCP connection to the host on the specified port

thilan

Member
Joined
Oct 8, 2019
Messages
5
Programming Experience
10+
Design and implement a solution in .net to monitor services. Design and implement in (.net) a service monitoring class. This monitor will be used to monitor the status of multiple services. A service is defined as a host/port combination. To check if a service is up, the monitor will establish a TCP connection to the host on the specified port. If a connection is established, the service is up, if the connection is refused, the service is not up.
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,049
Location
Sydney, Australia
Programming Experience
10+
So you think that you can just copy and paste your homework assignment and we'll take it from there? How about you do your own homework and we help you with specific problems you encounter along the way? Approach this as every developer should approach every project, i.e. break it down into smaller and smaller parts, research the parts that you don't already fully understand, implement what you can and then, when you encounter an actual issue, post a question in a new thread specific to that issue, providing all the relevant information regarding what you're trying to achieve, how you're trying to achieve it and what happens when you try.
 

thilan

Member
Joined
Oct 8, 2019
Messages
5
Programming Experience
10+
So you think that you can just copy and paste your homework assignment and we'll take it from there? How about you do your own homework and we help you with specific problems you encounter along the way? Approach this as every developer should approach every project, i.e. break it down into smaller and smaller parts, research the parts that you don't already fully understand, implement what you can and then, when you encounter an actual issue, post a question in a new thread specific to that issue, providing all the relevant information regarding what you're trying to achieve, how you're trying to achieve it and what happens when you try.
Not really, I do not copy and the pasted code. I do know socket programming. I want to know some references need to check for the above matter. It is a programming test I do. Above is not one of my projects.
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,049
Location
Sydney, Australia
Programming Experience
10+
If the specific question you want answered is "how do I open a TCP connection to a specific host on a specific port" then that's the question you should have asked. That said, I just searched the web for "c# tcp connection" and the very first result was the documentation for the TcpClient class, which is the very class you should be using. It doesn't appear that you've done any research prior to posting here. ALWAYS do what you can for yourself first.
 

thilan

Member
Joined
Oct 8, 2019
Messages
5
Programming Experience
10+
If the specific question you want answered is "how do I open a TCP connection to a specific host on a specific port" then that's the question you should have asked. That said, I just searched the web for "c# tcp connection" and the very first result was the documentation for the TcpClient class, which is the very class you should be using. It doesn't appear that you've done any research prior to posting here. ALWAYS do what you can for yourself first.
I will change the question the way mention. I did paste some project I saw to get some Idea. I will change the description now.
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,049
Location
Sydney, Australia
Programming Experience
10+
Not really, I do not copy and the pasted code. I do know socket programming. I want to know some references need to check for the above matter. It is a programming test I do. Above is not one of my projects.
For a start, none of that was explained. Secondly, you didn't actually ask a question but, instead, posted the requirements of a project. Either those requirements were provided to you by someone else, in which posting them here with no explanation is unacceptable4, or you are telling us to implement those requirements for some reason, which is also unacceptable. Either way, you have failed to provide an adequate explanation of what you want/expect and it's probably still not a legitimate topic even if you do that, because it's far too broad. At the very least, make an effort to explain yourself clearly.
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,049
Location
Sydney, Australia
Programming Experience
10+
I will change the question the way mention. I did paste some project I saw to get some Idea. I will change the description now.
If this is just an idea for a project that someone could implement then this is not really the place to post it. No one has asked for such a project and, if people find this thread by a web search, they are far more likely to be looking for an answer to a question and be disappointed by what they find. If someone is looking for project ideas, it's unlikely that they'll find this thread because there is nothing here to suggest that that's what it is. The title should summarise the thread so the title should indicate that it's a possible learning project for beginners and the first post should explain the idea in detail.
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
1,575
Location
Virginia Beach, VA
Programming Experience
10+
It is a programming test I do. Above is not one of my projects.
So if this is for a test (presumably as part of a job application), why are you asking us how to do this? Your ability or inability to answer a question should be what is reflected so that you can be fairly assessed. By cheating on this test, you'll end up like one of the other guys who frequently asks questions here and on DIC because he got a job by faking knowledge and experience that he didn't really have, and he now has to scramble for every little bit of work assigned to him by asking here how to do it. He is forced to ask because he doesn't have time to go up the learning curve by himself due to his having to faked his competence at work.
 
Top Bottom