-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unified to throw NotSupportedException when SendFile() for connection…
…less sockets (#87108) * Unified to throw NotSupportedException when SendFile() for connectionless sockets The issue was that the Socket.SendFile() threw inconsistent exceptions when the platform was Windows and the protocol was UDP. The first call would throw a SocketException, while the second call would throw a NotSupportedException. With this commit, SendFile() will consistently throw NotSupportException on all platforms when the protocol is UDP. Fix #47472 * Change to throws `NotSupportedException` if `!IsConnectionOriented` or `!Connected`. Before:. Throws `NotSupportedException` on UDP. After: Throws `NotSupportedException` if `!IsConnectionOriented` or `!Connected`. * Changed test case `UdpConnection_ThrowsException` to run regardless of platform. * Update src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs Co-authored-by: Karel Zikmund <[email protected]> --------- Co-authored-by: Karel Zikmund <[email protected]>
- Loading branch information
1 parent
b355725
commit 24f1513
Showing
3 changed files
with
5 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters