Click here to Skip to main content
15,908,444 members
Home / Discussions / C#
   

C#

 
GeneralAsync model question Pin
Ryan Cromwell10-Sep-03 5:05
Ryan Cromwell10-Sep-03 5:05 
What is the suggested thread model for a Listener class? My particular situation involves an asyncronous multicast client that continuously listens for available data and notifies via delegates of received data. The problem is the receive function becomes a blocker if the sender no longer publishes data and the ListenHelper function will never progress. I realize that I could Abort the thread, but for some reason that seems like poor solution. Maybe not. See the snippet below:

class AsyncMCListener {
BeginListen
{
_thListener = new Thread( new ThreadStart( ListenHelper ) );
_thListener.IsBackground = true;
_thListener.Priority = ThreadPriority.BelowNormal;
_thListener.Start();
}
ListenHelper {
while( !_bDone ) {
ReceiveData //BLOCKING CALL
NotifyConsumerDataReady
}
}
EndListen {
_bDone = true;
}
}


GeneralRe: Async model question Pin
Eric Gunnerson (msft)10-Sep-03 12:16
Eric Gunnerson (msft)10-Sep-03 12:16 
GeneralRe: Async model question Pin
Ryan Cromwell10-Sep-03 13:35
Ryan Cromwell10-Sep-03 13:35 
Generalsimple question... Pin
.gonad10-Sep-03 4:28
.gonad10-Sep-03 4:28 
GeneralRe: simple question... Pin
Nick Seng10-Sep-03 16:12
Nick Seng10-Sep-03 16:12 
GeneralEuros and decimal.Parse Pin
Simon_uk10-Sep-03 3:23
Simon_uk10-Sep-03 3:23 
GeneralRe: Euros and decimal.Parse Pin
Simon_uk10-Sep-03 22:34
Simon_uk10-Sep-03 22:34 
GeneralRe: Euros and decimal.Parse Pin
Member 9611-Sep-03 18:30
Member 9611-Sep-03 18:30 
GeneralStandardPrinter Pin
gecko2310-Sep-03 3:14
gecko2310-Sep-03 3:14 
GeneralUsing ODBC databases Pin
Emilio Guijarro10-Sep-03 3:10
Emilio Guijarro10-Sep-03 3:10 
GeneralRe: Using ODBC databases Pin
joan_fl10-Sep-03 4:19
joan_fl10-Sep-03 4:19 
GeneralRe: Using ODBC databases Pin
Emilio Guijarro10-Sep-03 5:31
Emilio Guijarro10-Sep-03 5:31 
GeneralRe: Using ODBC databases Pin
David Stone10-Sep-03 5:37
sitebuilderDavid Stone10-Sep-03 5:37 
GeneralHelp: Object reference not set to an instance of an object. Pin
gros194410-Sep-03 1:30
gros194410-Sep-03 1:30 
GeneralRe: Help: Object reference not set to an instance of an object. Pin
Julian Bucknall [MSFT]10-Sep-03 5:07
Julian Bucknall [MSFT]10-Sep-03 5:07 
GeneralRe: Help: Object reference not set to an instance of an object. Pin
gros194412-Sep-03 1:16
gros194412-Sep-03 1:16 
QuestionBook: C# Unleashed - Any good ? Pin
Stone Free10-Sep-03 0:33
Stone Free10-Sep-03 0:33 
AnswerRe: Book: C# Unleashed - Any good ? Pin
Mazdak10-Sep-03 2:40
Mazdak10-Sep-03 2:40 
GeneralRe: Book: C# Unleashed - Any good ? Pin
Stone Free10-Sep-03 3:07
Stone Free10-Sep-03 3:07 
GeneralRe: Book: C# Unleashed - Any good ? Pin
Mazdak10-Sep-03 5:34
Mazdak10-Sep-03 5:34 
GeneralPlease, help me! Pin
Giant Penguin10-Sep-03 0:20
Giant Penguin10-Sep-03 0:20 
GeneralContextMenu problem Pin
Mazdak9-Sep-03 23:28
Mazdak9-Sep-03 23:28 
GeneralRe: ContextMenu problem Pin
James T. Johnson10-Sep-03 8:25
James T. Johnson10-Sep-03 8:25 
GeneralRe: ContextMenu problem Pin
Mazdak10-Sep-03 9:08
Mazdak10-Sep-03 9:08 
GeneralRe: ContextMenu problem Pin
James T. Johnson10-Sep-03 9:24
James T. Johnson10-Sep-03 9:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.