Commit Graph
70 Commits
Author SHA1 Message Date
stephentoub 53f90194de Remove Client property from TcpClient and UdpClient
The property leaks through the abstraction.  It's rarely used.  And it complicates things on Unix due to exposing the underlying socket instance combined with difficulties with multiple connect calls on a single socket instance.

Until we have good reason to expose it in the contract, we're removing it from the contract before it's stable.


Commit migrated from https://github.com/dotnet/corefx/commit/30abd30421289509cd3bd18a9114501afdc0fb7c
2016-02-07 10:40:27 -05:00
Stephen Toub 6098df50ac Merge pull request dotnet/corefx#5867 from stephentoub/sockets_fixes
Disable Unix workarounds for Connect'ing to multiple endpoints

Commit migrated from https://github.com/dotnet/corefx/commit/d7588500cfb2476e707bfb8bb2ccbcfd0e1d7ce1
2016-02-06 16:55:49 -05:00
stephentoub ea4dc2fd57 Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/8b430175dfd99062e7463e2a03bc35cd48044286
2016-02-05 16:00:42 -05:00
Eric Eilebrecht dcadf9ec33 Keep accepted sockets open until the tests are done with them.
Prior to this change, a GC triggered at the wrong time could cause a newly-accepted Socket to be collected and finalized, closing the connection before the other end of the socket was done.  To avoid this, we keep a reference to the new socket until the test is done with the connection.

Fixes dotnet/corefx#5291, dotnet/corefx#3748, dotnet/corefx#3744, dotnet/corefx#3682, dotnet/corefx#3494.


Commit migrated from https://github.com/dotnet/corefx/commit/ef2facfa91c1681f6ab13bb4d40b68b4a839cedf
2016-02-04 13:32:36 -08:00
stephentoub 2a9801ce75 Make TcpClient.Connect with multiple endpoints work on Unix
Commit migrated from https://github.com/dotnet/corefx/commit/01a220e4ced33dd804a655620e30e55b7940deb4
2016-02-03 23:38:49 -05:00
stephentoub af20daa75f Mark tests as PlatformSpecific for Windows
Now that these Connect* APIs are throwing on Unix, marking a bunch of tests as Windows-only.  In doing so, I combined a bunch of tests using [Theory], so as to minimize boilerplate and the number of methods that need to be annotated as platform-specific.


Commit migrated from https://github.com/dotnet/corefx/commit/f69a6d73f8e4cbc97a79957322bd9f7303518bfd
2016-02-03 19:59:37 -05:00
dotnet-bot 39d1eab950 Update licensing headers
Commit migrated from https://github.com/dotnet/corefx/commit/7cad8486cbabbce0236bdf530e30db7036335524
2016-01-27 08:02:28 -08:00
Cristian Pop 643a78f92f Removing/updating TODOs from System.Net CSProj files
Commit migrated from https://github.com/dotnet/corefx/commit/2e7bd14c5e55ecda926977eef6d5717644783059
2016-01-26 16:15:32 -08:00
Wes Haggard 0998f93d2d Fixes the build warnings about conflicting references
Fixes https://github.com/dotnet/corefx/issues/5334

Majority of these warnings are just inconsistencies between different
versions of the references coming from project.json, including the closure.


Commit migrated from https://github.com/dotnet/corefx/commit/de55c401bcddf2cac40a72992329612e5f4b0c9f
2016-01-17 21:57:29 -08:00
Stephen Toub 8b2dab2341 Merge pull request dotnet/corefx#5461 from CIPop/sn_disable_tests
Disabling System.Net intermittently failing tests

Commit migrated from https://github.com/dotnet/corefx/commit/cc5065b76ed50e10e24f5183db0d3e866f8a621d
2016-01-15 16:20:16 -05:00
Cristian Pop 4a4173d992 Disabling System.Net intermittently failing tests. Adding new tests for reported issues. Fixing test csproj file.
Commit migrated from https://github.com/dotnet/corefx/commit/be32a60de7e4eead5b7d3e045ea3ce4e1a34e855
2016-01-15 11:44:04 -08:00
stephentoub 634207e46a Clean up Unix Domain Sockets example
- Separate the type out into its own file, to make it easier for others to consume
- Fix a bug that prohbited it from being used with Accept (removed min length validation in ctor)
- Added a test that does Connect/Accept and Send/Receive
- A few other cleanups in the existing tests


Commit migrated from https://github.com/dotnet/corefx/commit/627c008e69292a54d517541d2e0d6c14cc008a73
2016-01-14 19:22:40 -05:00
Stephen Toub 7e7598c93f Merge pull request dotnet/corefx#5350 from dagood/fix-project-dependencies-nugetexe
Fix project.json dependencies: xunit DNXCore incompatibility + invalid package dependencies

Commit migrated from https://github.com/dotnet/corefx/commit/d591a687578f01ead8421ee4898b7bf42e7d95d6
2016-01-13 16:06:59 -05:00
stephentoub 150f225fde Throw SocketException rather than PNSE for unsupported socket option on Unix
Match Windows exception type when an unsupported socket option is provided.


Commit migrated from https://github.com/dotnet/corefx/commit/2c5f89e42c95176323d94bbca537581474638ae7
2016-01-13 11:26:17 -05:00
dagood e401efd6af Add portable-net45+win8 import to tests.
Specifically, add the import to dnxcore50 frameworks entries where "xunit" is mentioned in the project.json.
This fixes `xunit.abstractions 2.0.0 is not compatible with DNXCore,Version=v5.0.`


Commit migrated from https://github.com/dotnet/corefx/commit/da2e8eb34efcaf70069223bc431d80909a2fc91d
2016-01-12 14:04:32 -06:00
stephentoub 6318ec9d57 Disable several System.Net tests that have been failing
Commit migrated from https://github.com/dotnet/corefx/commit/3456760d2e9fd755b4433b5516e656ce99607657
2016-01-11 09:08:31 -05:00
Eric Eilebrecht 012a1ff223 Re-enable tests that were blocked on dotnet/corefx#3610.
Commit migrated from https://github.com/dotnet/corefx/commit/1684decd5332f94b998f2e2e06b81bb43da8de1b
2016-01-06 13:22:59 -08:00
Wes Haggard f27c7dc024 Update project files adding default configurations
This add a default configuration before the Import of dirs.props
for any projects that don't have Debug as the default configuration.

Removed Configuration and Platform properties set after dirs.props
as they would have no affect and just cause confusion.

Removed OutputType=Library property as it isn't necessary.


Commit migrated from https://github.com/dotnet/corefx/commit/9e1da13cf6d5ff4b37b1867beb3411a2fe61da6a
2016-01-02 23:50:21 -08:00
Ilya Biryukov 331395bb14 Enable custom socket end points and allow Unix Domain Sockets
With code separation into System.Net.Primitives and System.Net.Sockets,
EndPoint extensibility was broken because System.Net.Sockets started to
use its own copy of SocketAddress and didn't respect SocketAddress that
a custom EndPoint may provide.

The fix is to allow conversion between SocketAddress from System.Net.Primitives
and System.Net.Sockets. This way custom implementations of EndPoint will
be able to provide their own SocketAddress and it'll be honored by the
Socket APIs.

The fix also allows sockets to use 'Unspecified' protocol type which is
needed for Unix Domain Sockets. There are several changes in socket test
server to allow tests pass protocol type.

Add new unit tests that use end point extensibility to implement Unix
Domain Sockets.

Fix dotnet/corefx#4777


Commit migrated from https://github.com/dotnet/corefx/commit/0d07c5c5be8f74d25cd64f11b63975a9243da440
2015-12-22 14:08:42 -08:00
dagood fbfb82cc8c Change all project.json files to validate. Remove lockfiles from source control and add to gitignore.
A few new references to pick up changes that happened over time.


Commit migrated from https://github.com/dotnet/corefx/commit/0d881222d8c3269157639e2e67056e5a83aad834
2015-12-09 16:25:26 -06:00
David Shulman bb6e0b1816 Address PR feedback 2
Commit migrated from https://github.com/dotnet/corefx/commit/b20a16c6f10c29e364a60102ded9e876cba00526
2015-12-08 19:05:21 -08:00
David Shulman 6588a8a83e Adjust tests for Windows vs. non-Windows platforms
Commit migrated from https://github.com/dotnet/corefx/commit/1000c225694b2a5e368a888f8bb99d7613ff2876
2015-12-08 15:08:27 -08:00
David Shulman 38a53008cb Remove unneeded 'using' statement
Commit migrated from https://github.com/dotnet/corefx/commit/b3097031439058c6ae1d86c63ac4278c0d4c1efe
2015-12-08 14:16:43 -08:00
David Shulman 02030f5ba5 Address PR feedback
* Use Capability and RuntimeInformation patterns
* Add sample PowerShell setup scripts
* Add tests for non-Window10 platforms including *NIX


Commit migrated from https://github.com/dotnet/corefx/commit/848bcba62167354bfdda1683edd323f0a17e36c9
2015-12-08 14:11:23 -08:00
David Shulman 5f62a13ebc Add System.Net.Sockets, SocketOptionName.ReuseUnicastPort
As per the System.Net.* API review dotnet/apireviewsdotnet/corefx#21 adding back
the SocketOptionName.ReuseUnicastPort enum value. Also, reserving
SocketFlags.MaxIOVectorLength=16 enum value to prevent future conflicts.

Part of dotnet/corefx#4732


Commit migrated from https://github.com/dotnet/corefx/commit/362011ea0a350c5a37a61c45178d8eb81fb7ca19
2015-12-08 10:10:12 -08:00
Eric St. John 65210efd31 Update project.lock.json to latest and lock
Commit migrated from https://github.com/dotnet/corefx/commit/6aeea5eabf2aff3baf15f501cabd156dfc5b3f8f
2015-11-09 22:38:10 -08:00
Eric St. John cddddd29f5 Remove unused dependencies
Commit migrated from https://github.com/dotnet/corefx/commit/78fd45ec74afc507a40df519b4df650ac9bd4c42
2015-11-09 22:37:37 -08:00
David Shulman a866c07c6a Adjust System.Net.Sockets implementation to match contract
The System.Net.Sockets 4.1 contract (refs folder) does NOT have public methods for Socket.Close() or NetworkStream.Close().
However, the implementional DLL was still having public methods for these.

Removed the Close() methods and related fields.


Commit migrated from https://github.com/dotnet/corefx/commit/75522e90ec60b450b8eb070f6b257b12bd120615
2015-11-05 13:51:02 -08:00
Pat Gavlin 6395665c89 Readjust a Sockets test to accommodate OS X.
OS X returns yet another different error code when an IPv4 socket address is
passed to recvmsg on an IPv6-only socket.

Fixes dotnet/corefx#4003.


Commit migrated from https://github.com/dotnet/corefx/commit/62f40087b5b694ad2e453c44811cd420304703ee
2015-10-26 14:19:43 -07:00
Pat Gavlin 2cd5063f2d Update a socket test to accommodate differences on *nix.
On *nix, the SendTo APIs return ENETUNREACH instead of EFAULT when confronted
with a socket address with an invalid address family: these platforms check
the family of the provided socket address before checking its size (as long as
the socket address is large enough to store an address family).

Fixes dotnet/corefx#4003.


Commit migrated from https://github.com/dotnet/corefx/commit/2b6725de621c93d32ccb386d2ba5fe11598d689d
2015-10-23 14:28:16 -07:00
Matt Ellis f23deed6ba Merge 'upstream/master' into from-tfs
Conflicts:
	src/Common/test-runtime/project.lock.json
	src/System.Reflection.TypeExtensions/src/project.json
	src/System.Reflection.TypeExtensions/src/project.lock.json


Commit migrated from https://github.com/dotnet/corefx/commit/262aebcb35b4e0b09b1e08d37cdd70de3fb092e8
2015-10-22 13:15:56 -07:00
Eric St. John 8cc3c24b51 Update lock files that were missed in previous restore.
A change was made to DNX to no longer restore project.jsons
that are in nested folders.  This caused my batch update to miss
a number of tests and reference assembly projects.

This fixes the stale lock files, but restore is still broken.

[tfs-changeset: 1540448]


Commit migrated from https://github.com/dotnet/corefx/commit/3622cccc1b22fa1947a72d5126b59864e9d2fd0d
2015-10-21 18:59:09 -07:00
dotnet-bot d054048e1e Changing the API surfae of System.Net.Sockets for 4.1
Adding TPL Extension methods.
Adding APM wrappers using the TPL extensions.
Updating tests.

[tfs-changeset: 1540419]


Commit migrated from https://github.com/dotnet/corefx/commit/2d6de874008b0ba74c877c5895847421f3adf1af
2015-10-21 17:55:27 -07:00
Eric St. John 543808303a Update dnx to v1.0.0-rc1-15838, update dotnet projects to generations
We need a new DNX to understand the latest packages.

We also need to move all "dotnet" projects to use dotnetX.X (generations)
now that the packages no longer have "dotnet" assets.

The new version of DNX dropped support for the aspnetcore
so I needed to update a few projects/packages that depended
on old package versions that had this moniker.

[tfs-changeset: 1540388]


Commit migrated from https://github.com/dotnet/corefx/commit/38f8d7a3ca1ee819c2b8eabb1c07ee4e99683c97
2015-10-21 17:03:48 -07:00
Pat Gavlin 846b06da37 Fix TryGetIPPacketInformation on OS X.
CMSG_FIRSTHDR returns a non-null but empty message on OS X if there is
room in the control message buffer. Check for the empty message to avoid
looping forever.

This also changes an IPPacketInformation test to use IPv4 sockets (as
opposed to dual-stack IPv6 sockets) to get a non-default IPPacketInformation
value.


Commit migrated from https://github.com/dotnet/corefx/commit/754b8583155701eb50957ee4a85b38ff6d99a2a5
2015-10-21 16:55:43 -07:00
Pat Gavlin 8588460d82 Address PR feedback for System.Net.Sockets.
I've also replaced all of the dummy issues with the actual issue numbers.

Fixes dotnet/corefx#3441.


Commit migrated from https://github.com/dotnet/corefx/commit/4afa70011b975a557c3e5b57045185f94bc2587a
2015-10-20 16:21:39 -07:00
bartonjs a768025131 Update all project.lock.json files
Built Windows_NT, Linux, OSX with /p:LockDependencies=true.

CoreFX beta-* => 23419
xunit.netcore.extensions => 00107


Commit migrated from https://github.com/dotnet/corefx/commit/a14b22705df253508bd5f2dab0407bd2c7e4d639
2015-10-19 16:00:44 -07:00
Wes Haggard 8c3de054d8 Disable failing socket tests running in elevated mode
Some of the cases expected to fail don't actually fail when running
elevated. See https://github.com/dotnet/corefx/issues/3726. This
disables those test cases so the tests can run in elevated mode.


Commit migrated from https://github.com/dotnet/corefx/commit/52fd6a45dce86953a8172ca7b6bd7d43e85821b3
2015-10-15 20:59:30 -07:00
Pat Gavlin 0d43e74281 Merge pull request dotnet/corefx#3809 from pgavlin/PacketInformationCoverage
Fix bugs in IPPacketInformation.

Commit migrated from https://github.com/dotnet/corefx/commit/2fe24acc9217c7ea3328c544bab161b8734eca03
2015-10-13 10:37:09 -07:00
Pat Gavlin e959c4c359 Fix bugs in IPPacketInformation.
- GetHashCode() and Equals() both stood the chance of dereferencing a null
  pointer when called on default values.
- GetHashCode() was using a weak method of combining hash codes. This has
  been updated to use the same technique used by Roslyn.
- The equality and inequality operators were unnecessarily boxing input
  parameters.


Commit migrated from https://github.com/dotnet/corefx/commit/c71e33bf580075bbee039ce7ea99e231dc9bbda4
2015-10-13 08:49:04 -07:00
stephentoub ba9fea449f Reorganize src\Common\tests
Our common tests folder has gotten a bit unwieldy in its organization.  This change simply moves files around to better map to how src\Common\src is organized.  Files are now stored in a path based on functionality/namespace.

I mostly kept groups of functionality together and did not attempt to reorganize at that level, e.g. I moved the src\Common\tests\System.Xml.XPath\ folder to be src\Common\tests\System\Xml\XPath\ and did not further reorganize all of the folders/files it contains.  Such cleanup can be done separately on each individual area.

Some of the files also need to be cleaned up internally, e.g. the namespace (or lack thereof), so I put such things in a path that I thought made sense even if it differs from the current namespace in the file; I wanted this change to be relatively simple and just be about moving files around to clean up the main hierarchy.


Commit migrated from https://github.com/dotnet/corefx/commit/9a5546c439f7700d3462564678aa4206c7fbf4f1
2015-10-11 15:44:39 -04:00
Stephen Toub e5b7d239de Merge pull request dotnet/corefx#3710 from stephentoub/networkstream_async
Implement NetworkStream.ReadAsync/WriteAsync

Commit migrated from https://github.com/dotnet/corefx/commit/9a9909503e82d3eee09d9b80f18d3c807eaf48fa
2015-10-09 12:49:22 -04:00
Wes Haggard 54d844884a Fix dependency conflicts by explicitly matching them
We had a number of conflicts that could cause issues in the future
plus I wanted to clean out all the warnings.

This should take care of all the warnings of the form:

 C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5):
 warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.
 These reference conflicts are listed in the build log when log verbosity is set to detailed.


Commit migrated from https://github.com/dotnet/corefx/commit/b52306a2df60c2a73392ffe09364e2a8d4f6c03d
2015-10-08 17:36:25 -07:00
stephentoub 615fa9019d Add a few NetworkStream tests
Commit migrated from https://github.com/dotnet/corefx/commit/0d0e2f9ce2301befe3396c5c5c9aecb1c8cf5dc8
2015-10-08 18:59:53 -04:00
Cristian Pop c9b4e626eb Increasing timeout values for sockets tests.
Increased expected success timeouts to 5s and expected failures to 0.1s.
Adding Sockets common configuration and extracting timeout common parameters.

Fix dotnet/corefx#3504, dotnet/corefx#3641


Commit migrated from https://github.com/dotnet/corefx/commit/77fb5b238f66c7a22cc3e67362a4048d2edaabf2
2015-10-07 14:30:12 -07:00
Pat Gavlin 6adc0b9e12 Merge pull request dotnet/corefx#3648 from pgavlin/SocketsCoverage
Add Tcp{Client,Listener} and UdpClient SendReceive tests.

Commit migrated from https://github.com/dotnet/corefx/commit/74c16791e3c0ef680208535d64feca6079cb55d9
2015-10-06 15:03:21 -07:00
Stephen Toub 9add629eee Merge pull request dotnet/corefx#3664 from stephentoub/disable_socket_perf
Disable socket perf tests

Commit migrated from https://github.com/dotnet/corefx/commit/74b01b5a8b1cfa16ae42de3dd77b85742a7e20eb
2015-10-06 16:26:56 -04:00
stephentoub bb3bbc6ef2 Disable socket perf tests
These are currently in outer loop, but they're sporadically failing due to lack of appropriate infrastructure to accurately run and measure them.


Commit migrated from https://github.com/dotnet/corefx/commit/1bb1c02ef617c4f8c59a5b86bc7f5039b036c649
2015-10-06 12:05:19 -04:00
dotnet-bot dfa25896ef Porting System.Net.NetworkInformation and System.Net.Utility to GitHub.
Completing dotnet/corefx#894


Commit migrated from https://github.com/dotnet/corefx/commit/5a67678925c2f2731fdb55eb3c88a287149e8db4
2015-10-05 17:24:18 -07:00
Pat Gavlin 444cc2cd6a Address further PR feedback.
Commit migrated from https://github.com/dotnet/corefx/commit/84c1bd5ab4711c31db175b958fac96b5f3ff9aad
2015-10-05 15:05:03 -07:00