Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2076406
  • 博文数量: 519
  • 博客积分: 10070
  • 博客等级: 上将
  • 技术积分: 3985
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-29 14:05
个人简介

只问耕耘

文章分类

全部博文(519)

文章存档

2016年(1)

2013年(5)

2011年(46)

2010年(220)

2009年(51)

2008年(39)

2007年(141)

2006年(16)

我的朋友

分类: Java

2010-04-16 10:17:31

TCPMon Tutorial
Content

Introduction
Structure and Dependencies
Usage Patterns
As an Explicit Intermediate
As a Request Sender for Web Services
As a Proxy
Advanced Settings
Slow Connection Simulation
HTTP Proxy support
Conclusion
Introduction

TCPMon is a utility that allows the user to monitor the messages passed along in TCP based conversation. It is based on a swing UI and works on almost all platforms that Java supports. The aim of this simple tutorial is to explain how TCPMon works and also to explain some of its features.

Structure and Dependencies

TCPMon has absolutely no dependencies on third party libraries. But some of the UI features rely on JDK 1.4 so TCPMon needs a JRE that is 1.4 or higher.

Usage Patterns

As an Explicit Intermediate

The most common usage pattern for the TCPMon is as an intermediary. It is called explicit since the client has to point to the intermediary rather than the original endpoint in order to monitor the messages. The following figure explains this concept.

concept

In order to start the TCPMon in this configuration one has to provide the host name and the port for the listener in the admin screen. See image below.

first screen

Pressing the 'add' button opens up a new tab that allows the messages to be seen as in the following screen

message screen

At this point the requester should point to the listener port of the TCPMon instead of the original endpoint. Let us understand this with an example:

Say all messages passed between needs to be monitored.

Step 1 - Add a listener with host as and port as 80. Set the listener to port 8080 which may be any unused port in the local machine

the settings

Step 2 - Point the browser to localhost:8080 instead of .

browser address bar

Once the messages start flowing they can be seen in the relevant tab as seen below.

Filles screen

The bottom controls allow the messages to be XML formatted (useful in debugging Web services), save and resend the messages, and also to switch the layout of the message windows.

button set

As a Request Sender for Web Services

TCPMon can also be used as a request sender for Web services. The request SOAP message can be pasted on the send screen and then sent directly to the server.

request sender

As a Proxy

TCPMon can act as a proxy. To start the TCPMon at proxy mode, just select the proxy option from the radio buttons. When acting as a proxy, TCPMon only needs the listener port to be configured.

proxy

Advanced Settings

Slow Connection Simulation

TCPMon can simulate a slow connection, in which case the delay and the bytes to be dropped can be configured. This is specially useful in testing Web services.

slow-connection

HTTP Proxy support

If HTTP proxy support is required then that can also be set on the admin screen.

Conclusion

TCPMon is a simple and easy to use tool that has many benefits when developing message driven applications. It is particularly useful in developing Web services

阅读(861) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~