Well, I have been wondering, I can implement a basic port scanner, but it only works if the connection is open on the other computer,how do you detect whether or not there is some service on a port that is closed in unix? I know NMap can do it, I just dont have the source to look at.