Skip to content

Breaking change: Socket.LocalEndPoint updated on SendToAsync(SocketAsyncEventArgs e)Β #20949

Closed

Description

@antonfirsov

Socket.LocalEndPoint updated on SendToAsync(SocketAsyncEventArgs e)

Behavioral breaking change after fixing a bug reported in dotnet/runtime#915 (fixed by dotnet/runtime#808).

Version introduced

.NET 5 RC1

Old behavior

Unlike other variants of SendTo, the SendToAsync(SocketAsyncEventArgs e) method did not alter the LocalEndpoint property on the socket instance.

New behavior

Just like in case of SendTo or BeginSendTo/EndSendTo, the property LocalEndpoint returns the (implicitly bound) socket's local address after the successful completion of SendToAsync(SocketAsyncEventArgs e).

Reason for change

Fix a bug, and consolidate behavior accross sendto variants.

Recommended action

Alter code that assumes that SendToAsync will keep LocalEndpoint's value unchanged/null.

Category

  • ASP.NET Core
  • C#
  • Code analysis
  • Core .NET libraries
  • Cryptography
  • Data
  • Debugger
  • Deployment
  • Globalization
  • Interop
  • JIT
  • LINQ
  • Managed Extensibility Framework (MEF)
  • MSBuild
  • Networking
  • Printing
  • Security
  • Serialization
  • Visual Basic
  • Windows Forms
  • Windows Presentation Foundation (WPF)
  • XML, XSLT

Affected APIs

Socket.SendToAsync(SocketAsyncEventArgs e)
Socket.LocalEndpoint


Issue metadata

  • Issue type: breaking-change

Activity

  1. self-assigned this
    on Oct 7, 2020
  2. added a commit that references this issue on Oct 13, 2020
    56756bb
  3. added a commit that references this issue on Oct 13, 2020
    358ae43
  4. added a commit that references this issue on Oct 14, 2020
    39b1d5f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions