Timeline for Declaring that a function never returns
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 20, 2020 at 9:38 | comment | added | Nat |
@Fred: If it blocks, then it ought to be called Listen() , blocking until it's done listening (because blocking-until-completion is what sequential logic is all about). If it doesn't block the calling thread, then it ought to be called BeginListening() , blocking until it's done beginning the listening process.
|
|
Aug 20, 2020 at 9:35 | comment | added | Fred | no it doesn't need to sleep it can await reading new messages or using a blocking receive call. But since it listens for new connections for as long as the application is running, you probably want to do that on a different thread than the main thread. | |
Aug 20, 2020 at 9:31 | comment | added | Nat | @Fred: Are you imagining a listener that loops over polling for new messages and sleeping until the next poll? Because that'd seem to be a sequential operation. (I mixed "sequential" and "synchronous" a bit above in an attempt to keep it short.) | |
Aug 20, 2020 at 9:28 | comment | added | Fred | What about if it is a listener loop that listens for incoming connections on a port. The function could be declared as asynchronous but it would run forever so you cant do other things unless you run it on a different thread. | |
Aug 20, 2020 at 9:06 | history | edited | Nat | CC BY-SA 4.0 |
added 1 character in body
|
Aug 20, 2020 at 8:59 | history | edited | Nat | CC BY-SA 4.0 |
added 42 characters in body
|
Aug 20, 2020 at 8:46 | history | edited | Nat | CC BY-SA 4.0 |
deleted 162 characters in body
|
Aug 20, 2020 at 8:40 | history | answered | Nat | CC BY-SA 4.0 |