Solved

Multiple TCP connections from JSP to host application

Posted on 2003-11-10
7
321 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

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
how to access elements of included jsp  from parent jsp's save button 9 29
constructor overloading 2 96
servlet cookie finding by name 1 95
lessBy10  challenge 15 97
When using a search centre, I'm going to show you how to configure Sharepoint's search to only return results from the current site collection. Very useful when using Office 365 with multiple site collections.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our systems…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

739 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