FileStream(Context context, IntPtr handle, int blockSize, bool canRead, bool canWrite) : base(context) { this.Handle = handle; this.readBuffer = new byte [blockSize]; this.canRead = canRead; this.canWrite = canWrite; }
protected EventedStream(Context context, IntPtr handle) : base(context) { if (handle == IntPtr.Zero) throw new ArgumentException ("handle"); this.Handle = handle; this.readWatcher = new IOWatcher (Handle, EventTypes.Read, Context.Loop, HandleReadReady); this.writeWatcher = new IOWatcher (Handle, EventTypes.Write, Context.Loop, HandleWriteReady); }
public static FileStream Open(Context context, string fileName, int blockSize, OpenFlags openFlags) { var fd = Syscall.open (fileName, openFlags, FilePermissions.S_IRUSR | FilePermissions.S_IWUSR | FilePermissions.S_IROTH); var mask = OpenFlags.O_RDONLY | OpenFlags.O_RDWR | OpenFlags.O_WRONLY; var canRead = (openFlags & mask) == OpenFlags.O_RDONLY || (openFlags & mask) == OpenFlags.O_RDWR; var canWrite = (openFlags & mask) == OpenFlags.O_WRONLY || (openFlags & mask) == OpenFlags.O_RDWR; return new FileStream (context, new IntPtr (fd), blockSize, canRead, canWrite); }
PlainSocket(Context context, SocketInfo info) : base(context, info) { stream = new PlainSocketStream (this, new IntPtr (info.fd)); this.state = Socket.SocketState.Open; }
public PlainSocket(Context context) : base(context) { }
protected EventedSocket(Context context, SocketInfo info) : this(context) { address = info.Address.ToString (); port = info.port; }
public EventedSocket(Context context) : base(context) { }
public static FileStream Create(Context context, string fileName, int blockSize) { return Open (context, fileName, blockSize, OpenFlags.O_RDWR | OpenFlags.O_CREAT | OpenFlags.O_TRUNC); }