Skip to main content

NetworkStream Class

Namespace: System.Net.Sockets · Assembly: GHIElectronics.TinyCLR.Networking

No description available.

public class NetworkStream : Stream

Constructors

NetworkStream(Socket socket)

public NetworkStream(Socket socket) : this(socket, false)

No description available.

ParameterTypeDescription
socketSocket

NetworkStream(Socket socket, bool ownsSocket)

public NetworkStream(Socket socket, bool ownsSocket)

No description available.

ParameterTypeDescription
socketSocket
ownsSocketbool

Properties

CanRead

public override bool CanRead { get; }

Gets a value indicating whether the current stream supports reading. (inherited)

CanSeek

public override bool CanSeek { get; }

Gets a value indicating whether the current stream supports seeking. (inherited)

CanTimeout

public override bool CanTimeout { get; }

No description available.

CanWrite

public override bool CanWrite { get; }

Gets a value indicating whether the current stream supports writing. (inherited)

ReadTimeout

public override int ReadTimeout { get; set; }

How long to wait before timing out a read operation. (inherited)

WriteTimeout

public override int WriteTimeout { get; set; }

How long to wait before timing out a write operation. (inherited)

Length

public override long Length { get; }

Gets length of bytes in the stream. (inherited)

Position

public override long Position { get; set; }

Gets or sets the current possition in the stream. (inherited)

DataAvailable

public override bool DataAvailable { get; }

No description available.

Methods

Close(int timeout)

public void Close(int timeout)

No description available.

ParameterTypeDescription
timeoutint

Dispose(bool disposing)

protected override void Dispose(bool disposing)

Closes a response stream, if present. (inherited)

ParameterTypeDescription
disposingboolNot used.

Flush()

public override void Flush()

Writes unwritten data to the file. (inherited)

Read(byte[] buffer, int offset, int count)

public override int Read(byte[] buffer, int offset, int count)

Reads a block of bytes from the stream. (inherited)

ParameterTypeDescription
bufferbyte[]
offsetintThe byte offset in the array at which read bytes will be placed.
countintThe maximun number of bytes to read.

Returns int

Seek(long offset, SeekOrigin origin)

public override long Seek(long offset, SeekOrigin origin)

Sets the current position of this stream to a given value. (inherited)

ParameterTypeDescription
offsetlongThe offset of the positon relative to the origin.
originSeekOriginSpecified the beginning, end or current postion as a reference point to apply the offset.

Returns long — The new postion in the stream.

SetLength(long value)

public override void SetLength(long value)

Adjusts the length of the array. This can be used to trim the end of the array. (inherited)

ParameterTypeDescription
valuelong

Write(byte[] buffer, int offset, int count)

public override void Write(byte[] buffer, int offset, int count)

Writes a block of bytes to the file stream. (inherited)

ParameterTypeDescription
bufferbyte[]
offsetintThe byte offset in the array from which to start writing bytes to the stream.
countintThe number of bytes to write.

Fields

_socketType

protected int _socketType

No description available.

_remoteEndPoint

protected EndPoint _remoteEndPoint

No description available.

_disposed

protected bool _disposed

No description available.