Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

Asynchronous to synchronous thread conversion

Thread view: 
raavi - 25 Jan 2006 05:20 GMT
Hi
  I am now involved in a telnet application.i am using struts
framework for this.the problem i am facing is that i am using a number
of threads in this application and this threads are running
asynchronously and i can't get the stream in one thread from other
one.how is this possible? if anyone have any idea please tell me.Thanks
in advance.
Chris Smith - 25 Jan 2006 06:09 GMT
>    I am now involved in a telnet application.i am using struts
> framework for this.

You're using Struts for a telnet application?  Struts is a framework for
HTTP request-response processing using HTML.  It is not designed for
telnet -- which is a completely different protocol employing an
abstraction of constant two-way dialogue.  You won't have a lot of
success integrating the two; and you'd be better off just implementing a
telnet server on top of sockets.

> the problem i am facing is that i am using a number
> of threads in this application and this threads are running
> asynchronously and i can't get the stream in one thread from other
> one.how is this possible?

It's possible using shared state.  This could be a static field
somewhere, or it could be an object that you communicate to each of the
threads' Runnable instances when you create them.  Synchronization
becomes very important when you start using shared state, though, so
don't do this until you understand it well.  Doug Lea has a good book on
it.

Signature

www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.