I've actually built one... The port scanner portion works (it's also supposed to have a ping sweep in it... but uh, I haven't coded the ping sweep yet). I'll attach the source code after I comment it.
Here is the port scanner code I promised you, it's fully commented. Don't mind the ping sweeper that doesn't work, I haven't coded it yet, just started building it's interface, but do what you want with the scanner... the entire tpp is going to be open source. Enjoy.