Skip to content

Instantly share code, notes, and snippets.

View SteveSandersonMS's full-sized avatar

Steve Sanderson SteveSandersonMS

View GitHub Profile
@SteveSandersonMS
SteveSandersonMS / somefile.cs
Last active May 9, 2016 10:13 — forked from SteveSanderson/somefile.cs
Async void message loop
public class MyNetworkClient {
public event SomeDelegate OnException;
public async Task ConnectAsync(string address) {
await this.MakeTheActualConnection(address);
this.BeginReceiveLoop();
}
// It's async void! But is that bad?
// I know that an unhandled exception here is going to bring down the process, but where else do you want