C Board  

Go Back   C Board > General Programming Boards > Networking/Device Communication

Reply
 
LinkBack Thread Tools Display Modes
Old 03-31-2008, 09:11 AM   #1
Registered User
 
Join Date: Mar 2008
Posts: 4
Need to check Port 80 using C

Hiya there

I need to write a command line app that checks if Port 80 is ope for http requests or blocked. IF its blocked it would be good to be able to output what is blocking it (NOrton or another firewall for example) but this is not totally needed.

If anyone has any ideas, snippets, that would be great!

Thanks
PaperDoylie is offline   Reply With Quote
Old 03-31-2008, 03:56 PM   #2
Registered User
 
Join Date: Aug 2007
Posts: 20
Dunno if this helps? I haven't read it through....

http://tangentsoft.net/wskfaq/articles/lame-list.html
djnorthyy is offline   Reply With Quote
Old 03-31-2008, 04:21 PM   #3
Senior software engineer
 
brewbuck's Avatar
 
Join Date: Mar 2007
Location: Portland, OR
Posts: 5,768
Does nmap not suffice for this need?
brewbuck is offline   Reply With Quote
Old 04-01-2008, 03:52 AM   #4
Registered User
 
Join Date: Mar 2008
Posts: 4
Thanks for that

Hi

Thanks for the posts above. The winsocks stuff isn't really what I was after.

The NMAP tool does exactly what I need to be honest, except for two issue (there are always issues!)

1) it requires a user to install Winpcap (this has got to be more straightforward than that) and
2) The output is deemed to confusting for the client!

Any other ideas??

Andy
PaperDoylie is offline   Reply With Quote
Old 04-01-2008, 05:26 AM   #5
and the Hat of Ass
 
Join Date: Dec 2007
Posts: 814
Quote:
Originally Posted by PaperDoylie View Post
Any other ideas??

Andy
cURL?
rags_to_riches is offline   Reply With Quote
Old 04-01-2008, 07:55 AM   #6
Registered User
 
Join Date: Mar 2008
Posts: 4
Thanks

Yeah I download cURL, spent a while looking at it and got a bit lost to be honest.

I have also found

http://www.nirsoft.net/utils/cports.html

Which is good and the Microsoft tool

http://www.petri.co.il/quickly_find_...open_ports.htm

does something similar.

WOuld have liked to write it myself but time is off the essense!
PaperDoylie is offline   Reply With Quote
Old 04-01-2008, 09:47 PM   #7
Registered User
 
Join Date: Apr 2007
Location: Sydney, Australia
Posts: 217
-Create a socket
-Set the socket to non-blocking
-Call the connect function (it should return immediately)
-Use select with a timeout of 5 seconds. If there is a connection on port 80, select should return 1 WITHIN 5 seconds. If there is no connection, than select should return 0 AFTER 5 seconds.
-Close socket.
39ster is offline   Reply With Quote
Old 04-03-2008, 05:51 AM   #8
Registered User
 
Join Date: Mar 2008
Posts: 4
Smile Thanks for all the responses

In the end I did it in VS2005 using C++ not C.

IF anyone wants to see the project the please ask
PaperDoylie is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
serial port to poll on request infineonintern C++ Programming 2 06-11-2009 06:52 AM
Parallel Port IO ops not working properly microtechno Linux Programming 16 06-08-2009 12:33 PM
MFC check box question MyglyMP2 Windows Programming 2 03-09-2009 05:47 PM
connecting to server with wrong port liri Networking/Device Communication 3 11-13-2007 03:52 AM
BN_CLICKED, change button style bennyandthejets Windows Programming 9 09-11-2002 03:59 AM


All times are GMT -6. The time now is 03:31 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22