Bug 16832 - NetworkStream bool constructor parameter should be "ownsSocket" instead of "owns_socket"
Summary: NetworkStream bool constructor parameter should be "ownsSocket" instead of "o...
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 2.10.x
Hardware: PC All
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-12-16 23:29 UTC by Greg Najda
Modified: 2013-12-18 20:22 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Greg Najda 2013-12-16 23:29:08 UTC
Parameter names of public constructors are part of a class's public interface. You can pass parameters by name like

new NetworkStream(someSocket, ownsSocket: true)

to write code that is more clear. In .NET, the boolean parameter in the constructors of System.Net.Sockets.NetworkStream that take it is called "ownsSocket" (http://msdn.microsoft.com/en-us/library/te7e60bx%28v=vs.110%29.aspx). In Mono, it is called "owns_socket". This causes compilation to fail for programs that pass the parameter by name like above. Not sure if there are any effects at runtime when using an assembly compiled with .NET on Mono.
Comment 1 Andres G. Aragoneses 2013-12-17 17:12:28 UTC
https://github.com/mono/mono/pull/841
Comment 2 Andres G. Aragoneses 2013-12-18 04:03:31 UTC
Greg, the pull request was merged, can you mark the bug as FIXED please?
Comment 3 Greg Najda 2013-12-18 20:22:09 UTC
Thanks!