NonBlockingOperation() public method

public NonBlockingOperation ( Action operation, bool isRead ) : void
operation Action
isRead bool
return void
Example #1
0
 public static int WriteNoBlock(RubyIO/*!*/ self, [NotNull]MutableString/*!*/ val) {
     var stream = self.GetWritableStream();
     int result = -1;
     self.NonBlockingOperation(() => result = Write(self, val), false);
     return result;
 }
Example #2
0
 public static MutableString ReadNoBlock(RubyIO/*!*/ self, [DefaultProtocol]int bytes, [DefaultProtocol, Optional]MutableString buffer) {
     var stream = self.GetReadableStream();
     MutableString result = null;
     self.NonBlockingOperation(() => result = Read(self, bytes, buffer), true);
     return result;
 }
Example #3
0
 public static MutableString ReadNoBlock(RubyIO/*!*/ self, [DefaultProtocol]int bytes, [DefaultProtocol, Optional]MutableString buffer) {
     self.RequireReadable();
     MutableString result = null;
     self.NonBlockingOperation(() => result = Read(self, bytes, buffer), true);
     if (result == null) {
         throw new EOFError("end of file reached");
     }
     return result;
 }