Name
NetworkStream
Synopsis
This class creates a basic network stream from an underlying socket. It allows for simple data access to the stream and supports permissions settings.
public class NetworkStream : System.IO.Stream { // Public Constructors public NetworkStream(Socketsocket
); public NetworkStream(Socketsocket
, boolownsSocket
); public NetworkStream(Socketsocket
, System.IO.FileAccessaccess
); public NetworkStream(Socketsocket
, System.IO.FileAccessaccess
, boolownsSocket
); // Public Instance Properties public override bool CanRead{get; } // overrides System.IO.Stream public override bool CanSeek{get; } // overrides System.IO.Stream public override bool CanWrite{get; } // overrides System.IO.Stream public virtual bool DataAvailable{get; } public override long Length{get; } // overrides System.IO.Stream public override long Position{set; get; } // overrides System.IO.Stream // Protected Instance Properties protected bool Readable{set; get; } protected Socket Socket{get; } protected bool Writeable{set; get; } // Public Instance Methods public override IAsyncResult BeginRead(byte[ ]buffer
, intoffset
, intsize
, AsyncCallbackcallback
, objectstate
) // overrides System.IO.Stream public override IAsyncResult BeginWrite(byte[ ]buffer
, intoffset
, intsize
, AsyncCallbackcallback
, objectstate
) // overrides System.IO.Stream public override void Close( ); // overrides System.IO.Stream public override int EndRead(IAsyncResultasyncResult
); // overrides System.IO.Stream public ...
Get C# in a Nutshell, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.