Skip to main content

UdpClient Class

Namespace: System.Net.Sockets · Assembly: GHIElectronics.TinyCLR.Networking

No description available.

public class UdpClient : IDisposable

Constructors

UdpClient()

public UdpClient() : this(AddressFamily.InterNetwork)

No description available.

UdpClient(AddressFamily family)

public UdpClient(AddressFamily family)

No description available.

ParameterTypeDescription
familyAddressFamily

UdpClient(int port)

public UdpClient(int port) : this(port, AddressFamily.InterNetwork)

No description available.

ParameterTypeDescription
portint

UdpClient(int port, AddressFamily family)

public UdpClient(int port, AddressFamily family)

No description available.

ParameterTypeDescription
portint
familyAddressFamily

UdpClient(IPEndPoint localEP)

public UdpClient(IPEndPoint localEP)

No description available.

ParameterTypeDescription
localEPIPEndPoint

UdpClient(string hostname, int port)

public UdpClient(string hostname, int port)

No description available.

ParameterTypeDescription
hostnamestring
portint

Properties

Active

protected bool Active { get; set; }

No description available.

Available

public int Available { get; }

No description available.

Client

public Socket Client { get; set; }

No description available.

Methods

Dispose()

public void Dispose()

Releases buffered memory (the unmanaged firmware/application buffers). (inherited)

Dispose(bool disposing)

protected virtual void Dispose(bool disposing)

Closes a response stream, if present. (inherited)

ParameterTypeDescription
disposingboolNot used.

BeginSend(byte[] datagram, int bytes)

public int BeginSend(byte[] datagram, int bytes)

No description available.

ParameterTypeDescription
datagrambyte[]
bytesint

Returns int

BeginSend(byte[] datagram, int bytes, string hostname, int port)

public int BeginSend(byte[] datagram, int bytes, string hostname, int port)

No description available.

ParameterTypeDescription
datagrambyte[]
bytesint
hostnamestring
portint

Returns int

BeginSend(byte[] datagram, int bytes, IPEndPoint endPoint)

public int BeginSend(byte[] datagram, int bytes, IPEndPoint endPoint)

No description available.

ParameterTypeDescription
datagrambyte[]
bytesint
endPointIPEndPoint

Returns int

EndSend(IAsyncResult asyncResult)

public int EndSend(IAsyncResult asyncResult)

No description available.

ParameterTypeDescription
asyncResultIAsyncResult

Returns int

BeginReceive(int port)

public int BeginReceive(int port)

No description available.

ParameterTypeDescription
portint

Returns int

EndReceive(IAsyncResult asyncResult, ref IPEndPoint remoteEP)

public byte[] EndReceive(IAsyncResult asyncResult, ref IPEndPoint remoteEP)

No description available.

ParameterTypeDescription
asyncResultIAsyncResult
remoteEPref IPEndPoint

Returns byte[]

JoinMulticastGroup(IPAddress multicastAddr)

public void JoinMulticastGroup(IPAddress multicastAddr)

No description available.

ParameterTypeDescription
multicastAddrIPAddress

Close()

public void Close()

When overridden by a descendant class, closes the response stream. (inherited)

Connect(string hostname, int port)

public void Connect(string hostname, int port)

No description available.

ParameterTypeDescription
hostnamestring
portint

Connect(IPAddress addr, int port)

public void Connect(IPAddress addr, int port)

No description available.

ParameterTypeDescription
addrIPAddress
portint

Connect(IPEndPoint endPoint)

public void Connect(IPEndPoint endPoint)

No description available.

ParameterTypeDescription
endPointIPEndPoint

Receive(ref IPEndPoint remoteEP)

public byte[] Receive(ref IPEndPoint remoteEP)

No description available.

ParameterTypeDescription
remoteEPref IPEndPoint

Returns byte[]

Send(byte[] dgram, int bytes, IPEndPoint endPoint)

public int Send(byte[] dgram, int bytes, IPEndPoint endPoint)

Sends a UDP datagram to a specified port on a specified remote host. (inherited)

ParameterTypeDescription
dgrambyte[]
bytesint
endPointIPEndPoint

Returns int — The number of bytes sent.

Send(byte[] datagram, IPEndPoint endPoint)

public int Send(byte[] datagram, IPEndPoint endPoint)

Sends a UDP datagram to the host at the specified remote endpoint.

ParameterTypeDescription
datagrambyte[]An ReadOnlySpan{T} of Type byte that specifies the UDP datagram that you intend to send.
endPointIPEndPointAn IPEndPoint that represents the host and port to which to send the datagram.

Returns int — The number of bytes sent.

Send(byte[] dgram, int bytes, string hostname, int port)

public int Send(byte[] dgram, int bytes, string hostname, int port)

No description available.

ParameterTypeDescription
dgrambyte[]
bytesint
hostnamestring
portint

Returns int

Send(byte[] datagram, string hostname, int port)

public int Send(byte[] datagram, string hostname, int port)

Sends a UDP datagram to a specified port on a specified remote host.

ParameterTypeDescription
datagrambyte[]An ReadOnlySpan{T} of Type byte that specifies the UDP datagram that you intend to send.
hostnamestringThe name of the remote host to which you intend to send the datagram.
portintThe remote port number with which you intend to communicate.

Returns int — The number of bytes sent.

Send(byte[] dgram, int bytes)

public int Send(byte[] dgram, int bytes)

Sends a UDP datagram to the host at the specified remote endpoint. (inherited)

ParameterTypeDescription
dgrambyte[]
bytesint

Returns int — The number of bytes sent.

Send(byte[] datagram)

public int Send(byte[] datagram)

Sends a UDP datagram to a remote host.

ParameterTypeDescription
datagrambyte[]An ReadOnlySpan{T} of Type byte that specifies the UDP datagram that you intend to send.

Returns int — The number of bytes sent.