DotNetDupe
4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Toggle main menu visibility
Loading...
Searching...
No Matches
NetworkStream.h
Go to the documentation of this file.
1
5
6
#pragma once
7
8
#include "
Common.h
"
9
#include "
System/IO/Stream.h
"
10
#include "
System/Net/Sockets/Socket.h
"
11
#include "
System/SmartPointer.h
"
12
13
namespace
DotNetDupe
{
14
namespace
System
{
15
namespace
Net
{
16
namespace
Sockets
{
17
24
class
NetworkStream
:
public
IO::Stream
{
25
public
:
29
DOTNETDUPE_API
explicit
NetworkStream
(
const
SmartPointer<Socket>
& socket);
30
35
DOTNETDUPE_API
NetworkStream
(
const
SmartPointer<Socket>
& socket,
bool
bOwnsSocket);
36
38
DOTNETDUPE_API
~NetworkStream
();
39
42
DOTNETDUPE_API
bool
CanRead
()
const override
;
43
46
DOTNETDUPE_API
bool
CanSeek
()
const override
;
47
50
DOTNETDUPE_API
bool
CanWrite
()
const override
;
51
54
DOTNETDUPE_API
long
GetLength
()
const override
;
55
58
DOTNETDUPE_API
long
GetPosition
()
const override
;
59
62
DOTNETDUPE_API
void
SetPosition
(
long
value)
override
;
63
65
DOTNETDUPE_API
void
Flush
()
override
;
66
73
DOTNETDUPE_API
int
Read
(
char
* buffer,
int
offset,
int
count)
override
;
74
77
DOTNETDUPE_API
long
Seek
(
long
offset,
int
origin)
override
;
78
81
DOTNETDUPE_API
void
SetLength
(
long
value)
override
;
82
88
DOTNETDUPE_API
void
Write
(
const
char
* buffer,
int
offset,
int
count)
override
;
89
91
DOTNETDUPE_API
void
Dispose
()
override
;
92
94
DOTNETDUPE_API
void
Close
();
95
96
private
:
97
SmartPointer<Socket>
m_pSocket;
98
bool
m_bOwnsSocket;
99
bool
m_bDisposed;
100
};
101
102
}
103
}
104
}
105
}
Common.h
Defines common cross-platform macros, export decorators, and fundamental types.
DOTNETDUPE_API
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition
Common.h:20
SmartPointer.h
Provides reference-counted and weak pointer memory management primitives ensuring zero raw ownership.
Socket.h
Implements the Berkeley sockets interface for network communications.
Stream.h
DotNetDupe::System::IO::Stream
Provides a generic view of a sequence of bytes.
Definition
Stream.h:16
DotNetDupe::System::Net::Sockets::NetworkStream::CanWrite
bool CanWrite() const override
Gets a value that indicates whether the NetworkStream supports writing.
Definition
NetworkStream.cpp:40
DotNetDupe::System::Net::Sockets::NetworkStream::Write
void Write(const char *buffer, int offset, int count) override
Writes data to the NetworkStream.
Definition
NetworkStream.cpp:76
DotNetDupe::System::Net::Sockets::NetworkStream::SetPosition
void SetPosition(long value) override
Sets the current position of the stream. Not supported.
Definition
NetworkStream.cpp:52
DotNetDupe::System::Net::Sockets::NetworkStream::CanSeek
bool CanSeek() const override
Gets a value that indicates whether the stream supports seeking. Always returns false.
Definition
NetworkStream.cpp:36
DotNetDupe::System::Net::Sockets::NetworkStream::Read
int Read(char *buffer, int offset, int count) override
Reads data from the NetworkStream and stores it in the buffer.
Definition
NetworkStream.cpp:60
DotNetDupe::System::Net::Sockets::NetworkStream::Dispose
void Dispose() override
Releases the unmanaged resources used by the NetworkStream.
Definition
NetworkStream.cpp:84
DotNetDupe::System::Net::Sockets::NetworkStream::NetworkStream
NetworkStream(const SmartPointer< Socket > &socket)
Creates a new instance of the NetworkStream class for the specified Socket.
Definition
NetworkStream.cpp:11
DotNetDupe::System::Net::Sockets::NetworkStream::SetLength
void SetLength(long value) override
Sets the length of the stream. Not supported.
Definition
NetworkStream.cpp:72
DotNetDupe::System::Net::Sockets::NetworkStream::CanRead
bool CanRead() const override
Gets a value that indicates whether the NetworkStream supports reading.
Definition
NetworkStream.cpp:32
DotNetDupe::System::Net::Sockets::NetworkStream::GetPosition
long GetPosition() const override
Gets the current position within the stream. Not supported.
Definition
NetworkStream.cpp:48
DotNetDupe::System::Net::Sockets::NetworkStream::Flush
void Flush() override
Flushes data from the stream.
Definition
NetworkStream.cpp:56
DotNetDupe::System::Net::Sockets::NetworkStream::Close
void Close()
Closes the NetworkStream and releases all resources.
Definition
NetworkStream.cpp:94
DotNetDupe::System::Net::Sockets::NetworkStream::GetLength
long GetLength() const override
Gets the length of the data available on the stream. Not supported.
Definition
NetworkStream.cpp:44
DotNetDupe::System::Net::Sockets::NetworkStream::Seek
long Seek(long offset, int origin) override
Sets the current position of the stream to the given value. Not supported.
Definition
NetworkStream.cpp:68
DotNetDupe::System::SmartPointer
A unified smart pointer that supports both unique and shared ownership semantics.
Definition
SmartPointer.h:72
DotNetDupe::System::Net::Sockets
Definition
HttpClient.h:20
DotNetDupe::System::Net
Definition
Dns.h:13
DotNetDupe::System
Definition
Action.h:11
DotNetDupe
Definition
IServiceCollection.h:7
Include
System
Net
Sockets
NetworkStream.h
Generated by
1.18.0