5#include <system/array.h>
6#include <system/async_callback.h>
7#include <system/iasyncresult.h>
8#include <system/io/file_access.h>
9#include <system/io/seekorigin.h>
10#include <system/io/stream.h>
11#include <system/object.h>
12#include <system/shared_ptr.h>
14#include <net/sockets/socket.h>
16namespace System {
namespace Net {
namespace Sockets {
30 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
32 ASPOSECPP_SHARED_RTTI_INFO_DECL();
55 ASPOSECPP_SHARED_API int64_t
get_Length()
const override;
100 ASPOSECPP_SHARED_API int32_t
Read(
const System::Details::ArrayView<uint8_t>& buffer, int32_t offset, int32_t size)
override;
105 ASPOSECPP_SHARED_API
void Write(
const System::Details::ArrayView<uint8_t>& buffer, int32_t offset, int32_t size)
override;
109 ASPOSECPP_SHARED_API
void Close(
int timeout);
139 ASPOSECPP_SHARED_API
void Flush()
override;
141 ASPOSECPP_SHARED_API
void SetLength(int64_t value)
override;
A base class for a variety of stream implementations. Objects of this class should only be allocated ...
Definition: stream.h:24
Provides the underlying stream of the data for the network access. Objects of this class should only ...
Definition: network_stream.h:23
void Write(const ArrayPtr< uint8_t > &buffer, int32_t offset, int32_t size) override
Writes the specified subrange of bytes from the specified byte array to the stream.
NetworkStream(System::SharedPtr< System::Net::Sockets::Socket > socket, bool ownsSocket)
Constructs a new instance.
void SetLength(int64_t value) override
Sets the length of the stream represented by the current object.
bool get_CanWrite() const override
Determines if the stream is writable.
void EndWrite(System::SharedPtr< IAsyncResult > asyncResult) override
Ends an asynchronous write operation. Waits until the specified asynchronous write operation complete...
System::SharedPtr< IAsyncResult > BeginWrite(System::ArrayPtr< uint8_t > buffer, int32_t offset, int32_t size, AsyncCallback callback, System::SharedPtr< Object > state) override
Initiates an asynchronous write operation.
int32_t get_WriteTimeout() const override
Gets a value, in milliseconds, that determines how long the stream will attempt to write before timin...
int32_t get_ReadTimeout() const override
Gets a value, in milliseconds, that determines how long the stream will attempt to read before timing...
virtual ~NetworkStream()
Destructs the current instance.
void set_WriteTimeout(int32_t value) override
Sets a value, in milliseconds, that determines how long the stream will attempt to read before timing...
System::SharedPtr< IAsyncResult > BeginRead(System::ArrayPtr< uint8_t > buffer, int32_t offset, int32_t size, AsyncCallback callback, System::SharedPtr< Object > state) override
Initiates an asynchronous read operation.
int64_t get_Length() const override
Returns the length of the stream in bytes.
void Write(const System::Details::ArrayView< uint8_t > &buffer, int32_t offset, int32_t size) override
Writes the specified subrange of bytes from the specified byte array to the stream.
NetworkStream(System::SharedPtr< System::Net::Sockets::Socket > socket, System::IO::FileAccess access, bool ownsSocket)
Constructs a new instance.
int64_t Seek(int64_t offset, IO::SeekOrigin origin) override
Sets the position of the stream represented by the current object.
bool get_CanRead() const override
Determines if the stream is readable.
bool get_CanSeek() const override
Determines if the stream supports seeking.
int32_t Read(const System::Details::ArrayView< uint8_t > &buffer, int32_t offset, int32_t size) override
Reads the specified number of bytes from the stream and writes them to the specified byte array.
NetworkStream(System::SharedPtr< System::Net::Sockets::Socket > socket)
Constructs a new instance.
bool get_DataAvailable() const
Returns a value that indicates if the there is available data to read.
void set_Position(int64_t value) override
Sets the stream's position.
void set_ReadTimeout(int32_t value) override
Sets a value that determines whether the current stream can time out.
System::SharedPtr< System::Net::Sockets::Socket > get_Socket()
Gets the underlying Socket.
int32_t Read(const ArrayPtr< uint8_t > &buffer, int32_t offset, int32_t size) override
Reads the specified number of bytes from the stream and writes them to the specified byte array.
int64_t get_Position() const override
Returns the current position of the stream.
void Close(int timeout)
Closes the current instance after the specified time expires.
void Flush() override
Clears this stream's buffers and writes all buffered data to the underlying storage.
bool get_CanTimeout() const override
Gets a value that determines whether the current stream can time out.
int32_t EndRead(System::SharedPtr< IAsyncResult > asyncResult) override
Waits until the specified asynchronous read operation completes.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
FileAccess
Specifies the type of access when opening the file.
Definition: file_access.h:11
SeekOrigin
Specifies the reference position in the stream relative to which the position to seek to is specified...
Definition: seekorigin.h:11
Definition: db_command.h:9
System::MulticastDelegate< void(SharedPtr< IAsyncResult >)> AsyncCallback
A delegate type that represents a method to be called when asynchronous operation completes.
Definition: async_callback.h:13