public void Complete(Action callback) { IAsyncWatcher completeWatcher = null; completeWatcher = Context.CreateAsyncWatcher(delegate { completeWatcher.Dispose(); callback(); }); completeWatcher.Start(); Stream.End(completeWatcher.Send); }
public void Dispose() { Socket = null; if (Stream != null) { Stream.Dispose(); Stream = null; } if (end_watcher != null) { end_watcher.Dispose(); end_watcher = null; } if (completeWatcher != null) { completeWatcher.Dispose(); completeWatcher = null; } }
public void Dispose() { asyncWatcher.Dispose(); }