Solved

Multiple TCP connections from JSP to host application

Posted on 2003-11-10
7
322 Views
Last Modified: 2010-04-01
I have an application that I need to provide web based access to.

The existing application has a Java API that can be used to integrate with it, under the hood it just communicates via ASCII text strings via TCP/IP connections.

I have implemented JSP pages on a Tomcat server that use Beans I have created to call the various methods I require through the API.

My problem is this:

The application will only accept one connection from each TCP host, so using a web server I can only ever have one connection to the application open at any one time. This obviously presents problems when the number of concurrent users increases and performance degrades pretty sharply.

Is there any way to set-up the application (Tomcat / JSP / Bean side) to create multiple connections to the application host machine from the one Tomcat server?
0
Comment
Question by:quser
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 15

Accepted Solution

by:
jimmack earned 63 total points
ID: 9718606
Well that's a tricky one to answer.  There's nothing to stop the Tomcat side implementing multiple connections.  You seem to have implied that the problem is more at the other end:

>> The application will only accept one connection from each TCP host

If you can't change that, then you might be able to get around it with some network "jiggery-pokery"*, but I'm not quite sure how.

*According to TimYates, this is "Errr... a technical term" ;-)
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9719640
solution A, as jimmack said, change the other end and let it accept more connection from one single ip.

solution B, use virtual IP. that means assign multiple ip address to your server. it is OS level thing and platform dependent. then use Socket(InetAddress address, int port, InetAddress localAddr, int localPort)  to make multiple connections.

let us know if you have further enquires.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9721318
> *According to TimYates, this is "Errr... a technical term" ;-)

HAHAHA :-)
0
 

Author Comment

by:quser
ID: 9721421
An update,

It seems that from talking to the applications producers it will accept multiple connections from a single host through the API (not from their supplied client application though, that is were the confusion came).

However it seems that the application is not multi-threaded and so will block requests when busy.

I suppose I need a solution were I can initiate a request from my Bean / JSP and wait until I recieve a response from the server app?
0
 
LVL 14

Assisted Solution

by:kennethxu
kennethxu earned 62 total points
ID: 9723354
it is true that you should not make too much simultaneous connections even if the server app allows multiple connections. just like database connections.

you should implement a connection pool strategy, that can limit the number of simultaneous connections and eliminate the expensive cost to establish a network connection with server.

you can have a look at jakarta commons pool package, it will make you life a lot easier when implementing a connection pool:
http://jakarta.apache.org/commons/pool/

let us know.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows 10 Creator Update has just been released and I have it working very well on my laptop. Read below for issues, fixes and ideas.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question