public Action <Action, Action <Exception> > WriteFile(string file) { return(Continuation.FromAsync( (c, s) => socket.BeginSendFile(file, c, s), iasr => { socket.EndSendFile(iasr); })); }
public Action <Action <int>, Action <Exception> > Read(byte[] buffer, int offset, int count) { return(Continuation.FromAsync <int>( (c, s) => socket.BeginReceive(buffer, offset, count, SocketFlags.None, c, s), socket.EndSend)); }
public static Action <Action <T>, Action <Exception> > AsContinuation <T>(this IEnumerator <object> enumerator, Action <Action> trampoline) { return((result, exception) => Continuation.Enumerate <T>(enumerator, result, exception, trampoline)); }