Monitoring a port

Does anyone have any sample code on how to monitor a port?
I would like to write a small vb app that will monitor ports 21 and a few others. If someone connects to this port the app should be able to capture information about this connection.

If you are monitoring port 80, you will want a .close followed by a .listen in the DataRecieved event. Reason being that an http request will wait for the port to be closed or it will hang onto the connection waiting for more data to come back. Don't know how the other protocols manage this. This is just to back up VincentLawlor's excellent example (I think he should get the points) but this is a little program I wrote to trap http requests and log them to a file. It is basically to catch code red and sadmind attacks from my ISP so I can forward the log to the abuse address at my ISP. The GetHostFromIP function is just a reverse DNS lookup I found in some library somewhere on the net.

If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio. You will also find the …

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.