Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Proving a UDP port is closed

by davis (Vicar)
on Feb 01, 2011 at 14:54 UTC ( #885506=note: print w/replies, xml ) Need Help??


in reply to Re: Proving a UDP port is closed
in thread Proving a UDP port is closed

*nods at L~R

Hmmm. Maybe; I hadn't really thought of that... However, I'm not sure that a netstat would show all services that are started by inetd (the reason I switched to rpcbind here is because more people are likely to have rpcbind available, hence the failure's easier to prove). I'm also trying to get as close to evidential proof as possible -- e.g. "You want port 1234 closed?": "Let's prove it's closed by trying to connect to it"


davis

Replies are listed 'Best First'.
Re^3: Proving a UDP port is closed
by Limbic~Region (Chancellor) on Feb 01, 2011 at 15:00 UTC
    davis,
    The netstat command shows network information and is not concerned with what services/processes are running. Also, inetd isn't magical and can't establish a connection without a listener. In order for the server to accept connections on a port then there has to be a listener for that port. The netstat command can be used to show what listeners are out there.

    As far as proving it by attempting to connect to it, I would have no way of testing presently.

    Cheers - L~R

      Sorry, I realised the stupidity of what I'd said (the implied magic) fairly quickly! Yeah, grokking the "netstat -af inet" output would almost certainly work for me for both TCP and UDP listeners, but there's still something somehow... cleaner about the attempted connection method, at least in my head.

      davis

        Is it possible for a listener to black-hole the port, and soak up messages (possibly acting on them) with no replies or indication that it has happened to the outside world?

        Such a case would require checking for listener processes rather than just shouting at the computer and waiting for echoes.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://885506]
help
Chatterbox?
[Discipulus]: ovedpo15 A subroutine may be called using an explicit & prefix. The & is optional in modern Perl... see perlsub in docs and search for ampersand
[Discipulus]: it has some, even dangerous, implication
[Discipulus]: I still use but I also attract many critics for this: I use when I call subs defined in the very same file, just to recognize them. You can avoid (but sometimes is needed)
[marto]: believe it or not this is a SPAM account :P
[Discipulus]: it seems a legitimate one.. grin ..

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2018-05-22 12:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?