determine that is the port open

i want to write a program that get a port and a host from stdin and find if the port is open or no ...
could any one please help me ?
Start here...
http://nmap.org/
Topic archived. No new replies allowed.