コード例 #1
0
 public Action <Action, Action <Exception> > WriteFile(string file)
 {
     return(Continuation.FromAsync(
                (c, s) => socket.BeginSendFile(file, c, s),
                iasr => { socket.EndSendFile(iasr); }));
 }
コード例 #2
0
 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));
 }
コード例 #3
0
 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));
 }