Login  
Search All Forums
Dart Home | PowerTCP Telnet for .NET | Custom Development Reply | PowerTCP Telnet for .NET Topics | Forums   
AuthorForum: PowerTCP Telnet for .NET
Topic: Best practice to use a telnet component in a multithreading application
xplorer2k

From: Oxnard, CA USA
Posts: 33
Member Since: 03/27/09
posted March 18, 2010 2:41 PM

Hi Everyone,

What is the best practice to use a telnet component in a multithreading application:
1. Call individual telnet component i.e. telnet1, telnet2 . . . telnet10, or
2. Calling a single telnet component i.e. telnet1 and use the ThreadPool.QueueUserWorkItem(new WaitCallback(x method), object) to start 10 threads.

Thanks,
xplorer2k
Mike Baldwin (Admin)



From: Rome, NY USA
Posts: 114
Member Since: 04/11/00

Extra Support Options
Custom Application Development

posted March 24, 2010 11:20 AM

I would suggest you start worker threads and instantiate an instance of the Telnet class on each thread. Then you can do blocking send/receive calls until finished. Don't forget to close the connection before exiting each worker thread. Also, if you are updating the UI make sure you marshal back to the UI thread before doing so.

Thanks for using our products!
xplorer2k

From: Oxnard, CA USA
Posts: 33
Member Since: 03/27/09
posted March 24, 2010 11:48 AM

Thanks Mike,

On your comment "start worker threads and instantiate an instance of the Telnet class on each thread" -how could I determine when each of these threads have been completed? Is there a callback function that I could use to let me know when each of these threads have been completed?

Thanks again,
xplorer2k
Mike Baldwin (Admin)



From: Rome, NY USA
Posts: 114
Member Since: 04/11/00

Extra Support Options
Custom Application Development

posted March 24, 2010 3:58 PM

This would be a thread synchronization issue...there are many techniques you might use...they are fully documented in Visual Studio.

------
-Non-current subscribers must contact sales@dart.com to update subscription and receive continued support as needed.
------

xplorer2k

From: Oxnard, CA USA
Posts: 33
Member Since: 03/27/09
posted March 24, 2010 6:00 PM

Thanks again Mike,

Could you please share a simple sample code with 2 threads that shows how to implement this type of scenarios?

Thanks,
xplorer2k
Jamie Powell (Admin)

From: Rome, NY USA
Posts: 376
Member Since: 03/13/07

Extra Support Options
Custom Application Development

posted March 25, 2010 9:23 AM

Your issue needs to be handled through our administrative procedures prior to response. Please contact sales@dart.com directly regarding this issue. Thank you.
Reply | PowerTCP Telnet for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX