dcsimg
JFrame thread in ClientServer application?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Al_Lelopath
Posted On:   Thursday, September 9, 2004 10:38 AM

I am creating a client/server application, mostly in Java. It all runs on one box. The reason for the client/server setup is that the application will consist of modules in different languages with one module written in Visual Basic with a TCP/IP interface. I will have something like this: myJavaServer |_ myVBModule |_ myC++Module |_ myJavaModule myJavaServer is a thread. myJavaServer and myVBModule will communciate via TCP/IP, in which each has a state machine myJavaServer and myC++Module will probably communicate via the JNI. myJavaServer will simply call myJavaModule methods.    More>>

I am creating a client/server application, mostly in Java.
It all runs on one box.

The reason for the client/server setup is that the application will consist of modules in different languages
with one module written in Visual Basic with a TCP/IP interface.



I will have something like this:

myJavaServer

|_ myVBModule

|_ myC++Module

|_ myJavaModule




myJavaServer is a thread.

myJavaServer and myVBModule will communciate via TCP/IP, in which each has a state machine

myJavaServer and myC++Module will probably communicate via the JNI.

myJavaServer will simply call myJavaModule methods.




myJavaServer calls myVBModule, myC++Module, and myJavaModule sequentially,
i.e. it can't call myC++Module until myVBModule is done, can't call myJavaModule until myC++Module is done, and when myJavaModule is done, it will loop back and call myVBModule.

Each is acting on the same set of data.


One part of this data is a 2D array which I would like to display and refresh once each time around the loop
The display will be some JPanels on a JFrame.
How do I best integrate this with the rest of the program?
Do I make it a separate Thread?

   <<Less

Re: JFrame thread in ClientServer application?

Posted By:   cem_tekin  
Posted On:   Tuesday, September 28, 2004 01:06 AM

as far as java concerned, keep your frames and threads seperate. i build apps this way. when the program starts (server class) it creates it's own frame (server_frame class). all listeners are implemented in the server class so that it controls everything. when a client comes in it registers itself with the server and the server starts a new thread (client_thread class). don't forget to pass a server object to the thread class constructor so that you will have a way to communicate with it.


hope this helps.


cem.

About | Sitemap | Contact