csharp
public sealed class UdpDatagramSocketA real UDP socket.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Thin on purpose: everything that could be got wrong twice lives above the seam, where it is tested against an in-memory bus. What is left here is the two or three things a datagram socket needs to be told before it behaves — and each of them is a bug that only shows up in production, which is why they are here with a reason attached rather than in a settings file.
Fields and properties (1)
public EndPoint? LocalEndPointWhere this socket is, once it is bound.
Methods (4)
public UdpDatagramSocket(IPEndPoint endPoint)Binds a socket.
public void SendTo(ReadOnlySpan<byte> payload, EndPoint destination)Sends one datagram.
public bool TryReceiveFrom(Span<byte> buffer, out EndPoint from, out int length)Takes one datagram, if one is waiting.
public void Dispose()Closes the socket.
Used by (1)
- UdpDatagramSocketFactoryVixen.Net.Transport.Udp