Solved

Know UDP services

Posted on 2000-04-14
4
298 Views
Last Modified: 2010-04-02
How do know the UDP services running in a server ? For TCP services we may connect to that port ?

Any Idea how to know UDP services..?

Sanesh
0
Comment
Question by:sanesh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 2716088
'netstat -an' on a server command line will list all the open ports and their status i.e. listening etc
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 2716096
you can get their names form system32\drivers\etc\services
0
 

Expert Comment

by:Loggytronic
ID: 2717817
If you're wanting to do this from another computer, I think all you can do is send a message to that port and hope that if there is nothing there then you'll get an ICMP error message back - this translates to your sendto() or equivalent failing with some error. I've seen this, but I'm not sure if it's reliable or not. But this could just be because one of the test machines was windows.
0
 

Accepted Solution

by:
yuxiliu earned 50 total points
ID: 2718470
The socket interface provides a mechanism that allows a client or server to map a protocol name to the integer constant assigned to that progtocol. You can use this way to detect if server is runing with UDP protocol: passes the protocol name(here is UDP) in a string argument, and use "getprotobyname()" returns the address of a structure of type "protoent". if server do not support UDP protocol. it will return "NULL"

just like this:
#include "winsock.h" /*this contains protoent structure.*/

struct protoent *pptr;
if(pptr = getprotobyname("udp"))
{
 /*server supports UDP official protocol number is now in pptr->p_proto*/
}
else
{
  /* server do not support UDP handle it*/
}
}

this also can be used for TCP protocol
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question