System::Net::Sockets::NetworkStream class

NetworkStream class

Provides the underlying stream of the data for the network access. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

class NetworkStream : public System::IO::Stream

Methods

MethodDescription
BeginRead(System::ArrayPtr<uint8_t>, int32_t, int32_t, AsyncCallback, System::SharedPtr<Object>) overrideInitiates an asynchronous read operation.
BeginWrite(System::ArrayPtr<uint8_t>, int32_t, int32_t, AsyncCallback, System::SharedPtr<Object>) overrideInitiates an asynchronous write operation.
Close(int)Closes the current instance after the specified time expires.
EndRead(System::SharedPtr<IAsyncResult>) overrideWaits until the specified asynchronous read operation completes.
EndWrite(System::SharedPtr<IAsyncResult>) overrideEnds an asynchronous write operation. Waits until the specified asynchronous write operation completes.
Flush() overrideClears this stream’s buffers and writes all buffered data to the underlying storage.
get_CanRead() const overrideRTTI information.
get_CanSeek() const overrideDetermines if the stream supports seeking.
get_CanTimeout() const overrideGets a value that determines whether the current stream can time out.
get_CanWrite() const overrideDetermines if the stream is writable.
get_DataAvailable() constReturns a value that indicates if the there is available data to read.
get_Length() const overrideReturns the length of the stream in bytes.
get_Position() const overrideReturns the current position of the stream.
get_ReadTimeout() const overrideGets a value, in milliseconds, that determines how long the stream will attempt to read before timing out.
get_Socket()Gets the underlying Socket.
get_WriteTimeout() const overrideGets a value, in milliseconds, that determines how long the stream will attempt to write before timing out.
NetworkStream(System::SharedPtr<System::Net::Sockets::Socket>)Constructs a new instance.
NetworkStream(System::SharedPtr<System::Net::Sockets::Socket>, System::IO::FileAccess, bool)Constructs a new instance.
NetworkStream(System::SharedPtr<System::Net::Sockets::Socket>, bool)Constructs a new instance.
Read(const ArrayPtr<uint8_t>&, int32_t, int32_t) overrideReads the specified number of bytes from the stream and writes them to the specified byte array.
Read(const System::Details::ArrayView<uint8_t>&, int32_t, int32_t) overrideReads the specified number of bytes from the stream and writes them to the specified byte array.
Seek(int64_t, IO::SeekOrigin) overrideSets the position of the stream represented by the current object.
set_Position(int64_t) overrideSets the stream’s position.
set_ReadTimeout(int32_t) overrideSets a value that determines whether the current stream can time out.
set_WriteTimeout(int32_t) overrideSets a value, in milliseconds, that determines how long the stream will attempt to read before timing out.
SetLength(int64_t) overrideSets the length of the stream represented by the current object.
Write(const ArrayPtr<uint8_t>&, int32_t, int32_t) overrideWrites the specified subrange of bytes from the specified byte array to the stream.
Write(const System::Details::ArrayView<uint8_t>&, int32_t, int32_t) overrideWrites the specified subrange of bytes from the specified byte array to the stream.
virtual ~NetworkStream()Destructs the current instance.

Fields

FieldDescription
static NullA stream with no underlying storage.

See Also