Know UDP services

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
saneshAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
yuxiliuConnect With a Mentor Commented:
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
 
ShaunWildeCommented:
'netstat -an' on a server command line will list all the open ports and their status i.e. listening etc
0
 
ShaunWildeCommented:
you can get their names form system32\drivers\etc\services
0
 
LoggytronicCommented:
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
All Courses

From novice to tech pro — start learning today.