Monitor TCP transactions with TCPMon

If you have done any work with web services (especially SOAP) you will appreciate the value of a good TCP monitoring tool. Wireshark is arguably the best network monitoring tool available, but it is complicated and for monitoring plain old HTTP transactions is akin to hitting the proverbial nut with a sledgehammer. Fortunately Apache have TCPMon, a light-weight, Java-based TCP monitoring utility that lets you quickly see what TCP transactions are taking place between your computer and a server (be it local or remote).

TCPMon does not need to be installed, just download the latest version and execute the relevant startup script (.bat for Windows, .sh for OSX/Linux). There are very few options, but to monitor TCP traffic between your client and a server set the listen port to the local port you will be sending requests to and the target hostname/port to where you want the requests sent:

For example if you wanted to track TCP traffic between my browser and google.co.nz enter www.google.co.nz as the target hostname and port 80 as the target port. Then point your client (i.e. browser) to http://localhost:8888 (where 8888 is the listening port). TCPMon will take your inbound TCP request, forward it on to http://www.google.com:80 and record what gets returned. Whilst all this takes place you can sit back and inspect the TCP transactions. Okay completely useless to normal people, but for anyone that has had to debug a SOAP request quite invaluable.

 

Comparing Web Development with Java and .Net

I was recently asked to comment on what the pros and cons were of Java compared to ColdFusion and ASP.Net when it comes to Web development. I guess the first thing to get straight with this question is what exactly constitutes 'Java' in a Web development sense.

The basics of the two technologies

The diagram below outlines the elements that comprise of Java and .Net Web development.

Both technologies are very similar as in essence Microsoft based .Net on many of Sun's original Java concepts and borrowed a lot of Java syntax when designing C#. Both utilise managed containers in which code is compiled and executed within. These containers are referred to as the JavaVM or CLR runtime in Java and .Net respectively. Both managed containers have the ability to execute code written in a number of languages, for example it is not uncommon to have a .Net application written in both VB.Net and C#. Whilst not as common the Java runtime is also beginning to support multiple languages such as Python and Ruby. Increased emphasis has come on this ability after the meteoric rise to fame of the Ruby on Rails Web development framework.