dcsimg
Interrupting a socket accept() loop.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   mark_weisenfeld
Posted On:   Wednesday, June 5, 2002 01:46 PM

Indicated on this site is an example of how to set a listening socket timeout and have the thread doing the listening throw an exception to allow the socket listener loop to exit for processing other events or logging etc. FAQ ENTRY 525419 This is supposedly better than just runnning a "while(true){...}" loop with a listening socket; Question 1: Is this a very efficient way of doing this? I am developing on a Mac "OS X" machine where Apple recommends keeping exceptions to cases where absolutly neccessary. Apparently the generation of an exception on the Mac is quite a bottleneck (and possibly everywhere else). How are the pro.s doing it? Question 2: I cannot update my   More>>

Indicated on this site is an example of how to set a listening socket timeout and have the thread doing the listening throw an exception to allow the socket listener loop to exit for processing other events or logging etc.
FAQ ENTRY 525419
This is supposedly better than just runnning a "while(true){...}" loop with a listening socket;


Question 1:

Is this a very efficient way of doing this? I am developing on a Mac "OS X" machine where Apple recommends keeping exceptions to cases where absolutly neccessary. Apparently the generation of an exception on the Mac is quite a bottleneck (and possibly everywhere else). How are the pro.s doing it?


Question 2:
I cannot update my textarea in the main class (main Frame added Panel) from this thread class. Is this a dumb-attack or is there a trick?

Thanks everyone.

   <<Less

Re: Interrupting a socket accept() loop.

Posted By:   mark_weisenfeld  
Posted On:   Monday, June 10, 2002 11:02 AM

Disregard the last question. That was a Dumb-attack. I had not put together that I needed to init a static TextArea variable in a logger class before instantiating it in the other classes.



Thank you
About | Sitemap | Contact