how to find 80 port is in use or not
-
hi how to find 80 port is in use or not with c++ code or mfc
-
hi how to find 80 port is in use or not with c++ code or mfc
the only way I know is to attempt to connect to the port - if that fails, the most likely reason is, is that the port is in use There's some code here that may be useful - you should be able to rework it to suit your needs http://www.intelliproject.net/articles/showArticle/index/check_tcp_udp_port[^]
-
the only way I know is to attempt to connect to the port - if that fails, the most likely reason is, is that the port is in use There's some code here that may be useful - you should be able to rework it to suit your needs http://www.intelliproject.net/articles/showArticle/index/check_tcp_udp_port[^]
Garth J Lancaster wrote:
the only way I know is to attempt to connect to the port - if that fails, the most likely reason is, is that the port is in use
In use or unavailable? I ask because can't there be more than one connection to a port?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
-
Garth J Lancaster wrote:
the only way I know is to attempt to connect to the port - if that fails, the most likely reason is, is that the port is in use
In use or unavailable? I ask because can't there be more than one connection to a port?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
well your use of 'unavailable' hit the nail on the head for the case I was thinking of - 'client had disconnected, but port was in timeout-wait' - ergo, not technically in use .. this may be particular to the scenario/implementation I see if happen in (a lot, unfortunately) as to more than one connection to a port, I'd have to go back to my W Richard Stevens to check - I know what we 'see' happening in a lot of cases - eg multiple connectiins to tcp://w.x.y.z:80 may not necessarily be the case - the initial connection is accepted on that port, but then 'spun off' to be handled as a seperate conversation, leaving port 80 free Is that what you were thinking ?
-
hi how to find 80 port is in use or not with c++ code or mfc
I'm not sure if this is relevant to you, but you can call bind[^] on the ip address and port, check if it fails and see if the error is
WSAEADDRINUSE
.«_Superman_» _I love work. It gives me something to do between weekends.