Help on Server Socket Programming?

hello Friends,

I need your help on following:

I am the only person working on this project and the company wants me to prepare a infrastructure of this project and I should also give a demo of this project to my seniors. I will breif you up with my project:

1. There is this gif image of distillation column. i will be publishing it using JApplet or Applet.

2. This Image must be seen on internet.

3. On the circle of these Image the user will click(In all there are five circles, called as controllers)and a dialog box should open thru which user will input the float values(I am using the JOptionPane class to open this dialog box).

4. The inputed values will the be given to the C program which is the simulator for distillation column.

5. The C program will generate the output through iterations(Code entirely in C), the output of each program will then be poped up to over the image beside the respective controlled or under the respective controller but definetely over the same gif file.

6. The number of iteration will depend on how fast the C program converges the inputer parameters. And each output must be show over the gif image and when the final iteration value will appear it should remain on the image until some new value is inputted by the user again by clicking on any of the circle.

The proposed theory to do this project accoding to me is as follows:

1. Since each value must be thrown to the user. I beleive this is a real time project. So I decided to use Client Server Networking technology provided by java.

2. Then I figured out that in this project there should be 2 clients One is the GUI which is the Image screen to receive the input from the user and to show the output to the user. Second client is a java program sitting behind the server which will receive this input data from user and it will have an NATIVE method through which all this input will be given to the C simulator program.

3. The middle bridge between these two clients will be a server. Which will just pass the data to and fro from both the clients.

3. The C program will perform iterations using these input values from second client. This C program will then give each iterations output to the Java program using JNI technology. This second client then sends this output value to the GUI clients through server.

Well another very important thing, I am inexperience in the field of software so I had to do a lot of R&D and this is what I found out. Frankly I am really not sure whether this is the right path to approach to this project or there is some other correct and realistic way than this? Well friends i would certainly request you if you can suggest some other simple or rather correct path or else if this is the right path then would you please suggest me the possible hiches or perticular points where I should concentrate more.

Well i am eagerly waiting for your reply.

[3008 byte] By [vkotasthane] at [2007-9-26 2:56:52]
# 1

Since you are publishing your results on the net , it will be a better idea to use JSP?Servlet/Beans architecture instead of swing

I will propose a architecture as follows:

Client : Standard Browsers, IE and NS

Middle Tier: Java Webserver/Application Server

This will depend on your budget. If u have a fat allowance go for weblogic/websphere . If u are operationg on shoe string budget try for apache , etc

In the server tier code your application in the follwing architecture

JSP for presentation: Distillation towers picture, input boxes .. etc

Servlets for business logic invocation and routing requests: Your JSP submits input values to servlets, which does the processing using Java Bean Components. Since you have a lot of Logic written in C I would suggest to encapsulate these in JavaBean components using JNI technology and reuse the code.

After processing the servlet again forwards the response to another JSP for output

Advantages:

1.Your clients can be thin as most of the processing is done at the server

2. Thread Management is taken care of by your webserver, which otherwise would be a headache

3. Writing this through low level socket programming will be much more difficult as you will write your own protocol for communication this will be error prone and not scalable

If you still decide to go for traditional client server programming using swing, use RMI for communication as I insist that socket programming is very very cumbersome...using your own protocols

hope this helps

Shubhrajit

shubhrajit_c at 2007-6-29 10:48:19 > top of Java-index,Archived Forums,Portability & Platform Independence [Archive]...
# 2
there are two ways out.One follow expensive solutions like the ones given below (ie use servers like weblogic and websphere)or use our expert comments for a little fee offcourse.contact ironluca@yahoo.commg_mohit@yahoo.com
Ironluca at 2007-6-29 10:48:19 > top of Java-index,Archived Forums,Portability & Platform Independence [Archive]...