DotNetDupe
4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Toggle main menu visibility
Loading...
Searching...
No Matches
UdpClient.h
Go to the documentation of this file.
1
5
6
#pragma once
7
8
#include "
Common.h
"
9
#include "
System/Object.h
"
10
#include "
System/String.h
"
11
#include "
System/SmartPointer.h
"
12
#include "
System/Net/Sockets/Socket.h
"
13
14
namespace
DotNetDupe
{
15
namespace
System
{
16
namespace
Net
{
17
namespace
Sockets
{
18
24
class
UdpClient
:
public
Object
{
25
public
:
27
DOTNETDUPE_API
UdpClient
();
28
31
DOTNETDUPE_API
explicit
UdpClient
(
int
port);
32
36
DOTNETDUPE_API
UdpClient
(
const
String
& ip,
int
port);
37
39
DOTNETDUPE_API
~UdpClient
();
40
41
UdpClient
(
const
UdpClient
&) =
delete
;
42
UdpClient
&
operator=
(
const
UdpClient
&) =
delete
;
43
DOTNETDUPE_API
UdpClient
(
UdpClient
&& other)
noexcept
;
44
DOTNETDUPE_API
UdpClient
&
operator=
(
UdpClient
&& other)
noexcept
;
45
49
DOTNETDUPE_API
void
Connect
(
const
String
& ip,
int
port);
50
57
DOTNETDUPE_API
int
Send
(
const
char
* buffer,
int
offset,
int
size);
58
67
DOTNETDUPE_API
int
Send
(
const
char
* buffer,
int
offset,
int
size,
const
String
& ip,
int
port);
68
77
DOTNETDUPE_API
int
Receive
(
char
* buffer,
int
offset,
int
size,
String
& ip,
int
& port);
78
80
DOTNETDUPE_API
void
Close
();
81
84
DOTNETDUPE_API
SmartPointer<Socket>
GetClient
()
const
;
85
86
private
:
87
SmartPointer<Socket>
m_pClientSocket;
88
};
89
90
}
91
}
92
}
93
}
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
Object.h
Base object class for DotNetDupe mirroring .NET System.Object.
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.
String.h
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
DotNetDupe::System::Net::Sockets::UdpClient::Receive
int Receive(char *buffer, int offset, int size, String &ip, int &port)
Returns a UDP datagram that was sent by a remote host.
Definition
UdpClient.cpp:72
DotNetDupe::System::Net::Sockets::UdpClient::Connect
void Connect(const String &ip, int port)
Establishes a default remote host using the specified IP address and port number.
Definition
UdpClient.cpp:42
DotNetDupe::System::Net::Sockets::UdpClient::UdpClient
UdpClient(const UdpClient &)=delete
DotNetDupe::System::Net::Sockets::UdpClient::operator=
UdpClient & operator=(const UdpClient &)=delete
DotNetDupe::System::Net::Sockets::UdpClient::UdpClient
UdpClient()
Initializes a new instance of the UdpClient class.
Definition
UdpClient.cpp:10
DotNetDupe::System::Net::Sockets::UdpClient::Send
int Send(const char *buffer, int offset, int size)
Sends a UDP datagram to a remote host (used when Connect has established default host).
Definition
UdpClient.cpp:52
DotNetDupe::System::Net::Sockets::UdpClient::GetClient
SmartPointer< Socket > GetClient() const
Gets the underlying network Socket.
Definition
UdpClient.cpp:90
DotNetDupe::System::Net::Sockets::UdpClient::Close
void Close()
Closes the UDP connection.
Definition
UdpClient.cpp:82
DotNetDupe::System::Object
Supports all classes in the DotNetDupe class hierarchy.
Definition
Object.h:18
DotNetDupe::System::SmartPointer
A unified smart pointer that supports both unique and shared ownership semantics.
Definition
SmartPointer.h:72
DotNetDupe::System::String
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition
String.h:74
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
UdpClient.h
Generated by
1.18.0