Class UdpSocket
- Namespace
- NetCord.Gateway.Voice.UdpSockets
- Assembly
- NetCord.dll
public sealed class UdpSocket : IUdpSocket, IDisposable
- Inheritance
-
UdpSocket
- Implements
-
- Inherited Members
-
Constructors
UdpSocket()
Methods
Connect(string, int)
public void Connect(string hostname, int port)
Parameters
hostname
string
port
int
Dispose()
Send(ReadOnlySpan<byte>)
public void Send(ReadOnlySpan<byte> datagram)
Parameters
datagram
ReadOnlySpan<byte>
SendAsync(ReadOnlyMemory<byte>, CancellationToken)
public ValueTask SendAsync(ReadOnlyMemory<byte> datagram, CancellationToken cancellationToken = default)
Parameters
datagram
ReadOnlyMemory<byte>
cancellationToken
CancellationToken
Returns
- ValueTask
Events
DatagramReceive
public event Action<UdpReceiveResult>? DatagramReceive
Event Type
- Action<UdpReceiveResult>