40 Commits
Author SHA1 Message Date
Alexander Köplinger b3e3e4cc40 [System] Don't use DateTime.Now for measuring elapsed time
Use Stopwatch or DateTime.UtcNow instead which aren't affected
by things like daylight-saving time
2017-07-02 23:31:34 +02:00
Eberhard Beilharz cd39375a39 [System] Request 32-bit capabilities
This fixes a crash that happened when running in the debugger.
This fixes Xamarin-21261.

Change-Id: I0ccda9f3c11ec02457a932073665721be5e4e83e
2017-06-29 23:16:46 +02:00
Jochen Kühner 7b51e84dc5 Bugfix Ping.cs (#4936) 2017-05-29 23:05:34 +02:00
Andi McClure 2ffb9a35a7 Combined cherrypick of changes between mono-4.8.0-branch and orbis-branch-30
ORBIS #ifdefs in BCL, exclude several files and assembly directories
from the orbis build, HAVE_LOCALTIME_R define in C.
2017-03-30 17:57:00 -04:00
Henric Müller 65b7f542d6 Fixing tests that asume IPV4 when first adapter is IPV6 2017-01-25 16:34:09 +01:00
Marek Safar e1421384bd [System] Warnings cleanup 2017-01-03 17:05:26 +01:00
Marek Safar 95b0698304 [System] Clean up some warnings 2016-10-25 14:28:35 +02:00
Ludovic Henry c5df7e9669 [referencesource] Import parts of System.Net.Sockets.Socket (#3618) 2016-09-24 20:10:01 +02:00
amccague c025009af8 Task Based Ping - removed illegal use of ?. 2016-05-11 13:06:15 +01:00
amccague a342863ba1 Resolved bug (8554) with Task Based Ping API
https://bugzilla.xamarin.com/show_bug.cgi?id=8554

Added unit tests to cover the Asynchronous API and the Task Based API.

Fixed an issue with the Task Based API that would previously throw a
`NullReferenceException` when started as the `CancellationTokenSource`
was not instantiated.
The `CancellationTokenSource` was also not disposed of after use.
2016-05-11 12:23:05 +01:00
Rolf Bjarne Kvinge a9ca27bcaa [mscorlib][System] Use PlatformNotSupportedException instead of NotSupportedException when it makes sense. 2015-11-27 09:49:23 +01:00
Sebastien Pouliot 1b6f93898e [System][ios] Disable non-working Ping code (and non-existing DllImport)
* capget is not part of libc (libSystem.dylib) on iOS (or OSX); and
* There's no working Process class to invoke `ping` by itself leading to

[FAIL] DllImportTest.LackOfCapget : System.InvalidOperationException : Process has not been started.
 		  at System.Diagnostics.Process.get_HasExited () [0x00039] in /Users/poupou/git/xamarin/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Diagnostics/Process.cs:184

It's technically possible to implement ping on iOS [1] so the code is
not totally removed from the build (API remains identical to existing).

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=964
2015-11-26 14:55:00 -05:00
Rolf Bjarne Kvinge 828d7d782b [System] Remove Process.Start and related API from TvOS/WatchOS. 2015-11-25 12:55:58 +01:00
Marek Safar 4e27a21367 [system] Fix ping process exit code check 2015-02-11 12:04:50 +01:00
Zoltan Varga c1b4366932 [bcl] Remove NET_4_5 defines from class libs. 2015-01-13 16:34:23 -05:00
João Matos c7593a29f8 [System] Fixed Ping returning invalid results on OSX.
Simplify the code by re-using the OSX check from Platform which is more robust and add some tests to make sure we don't regress.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=25210.
2014-12-12 18:25:44 +00:00
Atsushi Eno 99d5e54c35 add Android-specific ping path. 2012-09-07 17:33:01 +09:00
Tomasz Żyźniewski d8e7d08c58 call the event after async operation's completed 2012-08-28 16:12:51 +02:00
Martin Baulig e0e29c6140 Add .NET 4.5 async methods to System.Net.NetworkInformation.Ping. 2012-06-02 19:42:40 +02:00
Miguel de Icaza f48ceb9860 [System] Removal of the NET_2_0 in the source code
Modulo the GUID in the assembly and the GUID embedded in some
field initializers that use the assembly GUID for their name, the
assemblies are idential before and after the patch.
2012-06-02 13:16:40 -04:00
Gonzalo Paniagua Javier 339909fd3f Proper tracking of ICMP requests and responses.
* Ping.cs: generates a random ICMP Identifier field per Echo to help
	match up pings and their responses. Now has valid TTL and timeouts apply to
	the correct pings.  Also fixed bugs were received Sequence and
	Identifier would be corrupt for values >255, and fixed corruption of
	the Data field.
	Patch by Michael Walsh that fixes bug #627330.
2010-08-09 13:23:15 -04:00
Gonzalo Paniagua Javier 55671bd0b2 2010-06-22 Gonzalo Paniagua Javier <[email protected]>
* Ping.cs: we need to read the output to give the process time
	to start. Fixes bug #591136.


svn path=/trunk/mcs/; revision=159372
2010-06-22 20:10:26 +00:00
Miguel de Icaza 11ca00c93b 2010-03-19 Miguel de Icaza <[email protected]>
* Eliminate warnings in a bunch of places.

svn path=/trunk/mcs/; revision=153923
2010-03-19 21:46:30 +00:00
Carlos Alberto Cortez aa17d4e326 2009-12-07 Carlos Alberto Cortez <[email protected]>
* Ping.cs: Try to detect the path to the bin command, since different
	Unix systems store it in different places.
	Fixes #519272.


svn path=/trunk/mcs/; revision=147831
2009-12-08 05:08:05 +00:00
Gonzalo Paniagua Javier 00c833429f 2009-09-29 Gonzalo Paniagua Javier <[email protected]>
* Ping.cs: fix the check for a time-out return value from 'ping'.


svn path=/trunk/mcs/; revision=142820
2009-09-29 05:57:15 +00:00
Gonzalo Paniagua Javier 454ccc913a 2009-09-19 Gonzalo Paniagua Javier <[email protected]>
* Ping.cs: if we receive a packet that is ignored, adjust the
	timeout. Fixes bug #538013.


svn path=/trunk/mcs/; revision=142250
2009-09-19 04:44:28 +00:00
Gonzalo Paniagua Javier 12f4ef3894 2009-05-03 Gonzalo Paniagua Javier <[email protected]>
* Ping.cs: we just need the address(es), not a host entry. This avoids
	querying the DNS server(s) when the target is an IP address.


svn path=/trunk/mcs/; revision=133459
2009-05-04 03:14:29 +00:00
Gonzalo Paniagua Javier db1184228b 2009-03-24 Gonzalo Paniagua Javier <[email protected]>
* Ping.cs: MacOS has different arguments for ping.
	Bug #486904 fixed.


svn path=/trunk/mcs/; revision=130154
2009-03-24 21:00:01 +00:00
Gonzalo Paniagua Javier dfb688280d 2009-01-26 Christian Prochnow <[email protected]>
* Ping.cs: ignore ICMP echo request packet in case we ping
	  localhost.

svn path=/trunk/mcs/; revision=124624
2009-01-27 03:51:13 +00:00
Gonzalo Paniagua Javier cd744f7acb 2008-12-20 Gonzalo Paniagua Javier <[email protected]>
* Ping.cs: use the new internal method in Socket to avoid having to
	throw exceptions when there's a timeout.


svn path=/trunk/mcs/; revision=121924
2008-12-20 10:53:59 +00:00
Gonzalo Paniagua Javier 28771e5482 2008-12-11 Gonzalo Paniagua Javier <[email protected]>
* Ping.cs: close the socket in SendPrivileged. Use Buffer.BlockCopy
	instead of Array.Copy. Return IPStatus.Unknown instead of throwing an
	exception for unknown status codes received.


svn path=/trunk/mcs/; revision=121278
2008-12-11 08:46:45 +00:00
Gonzalo Paniagua Javier b3db36863a 2008-11-20 Gonzalo Paniagua Javier <[email protected]>
* Ping.cs: the time for the arguments of 'ping' is in seconds. Don't
	read the output of running the command, since we trust the return
	code.


svn path=/trunk/mcs/; revision=119534
2008-11-20 23:15:54 +00:00
Atsushi Eno 801ecd1e6e 2008-10-27 Atsushi Enomoto <[email protected]>
* Ping.cs : use privileged mode for non-unix. On Windows there is
	  no /usr/bin/ping.


svn path=/trunk/mcs/; revision=117210
2008-10-27 21:51:30 +00:00
Marek Habersack a271f8ae6b 2008-07-14 Marek Habersack <[email protected]>
* Ping.cs: Use /bin/ping when running as non-root user
	(implementation by Jackson Harper <[email protected]>) or use
	raw sockets if running as root or if the current process has the
	CAP_NET_RAW Linux capability set while running as an unprivileged
	user.

svn path=/trunk/mcs/; revision=107871
2008-07-14 10:16:46 +00:00
Atsushi Eno 237d28ef60 2007-10-23 Atsushi Enomoto <[email protected]>
* Ping.cs : Do not call OnPingCompleted() at CancelAsync() it should
	  be called at RunWorkerCompleted. Simplified RunWorkerCompleted.


svn path=/trunk/mcs/; revision=87971
2007-10-23 10:06:35 +00:00
Atsushi Eno 4fd30c9f26 2007-09-06 Atsushi Enomoto <[email protected]>
* Ping.cs, PingReply.cs, PingCompletedEventArgs.cs : implemented
	  in managed code.


svn path=/trunk/mcs/; revision=85416
2007-09-06 13:56:47 +00:00
Sasha Kogan 2ea200459b Replace MonoTODO with MonoNotSupported
svn path=/trunk/mcs/; revision=80781
2007-06-26 13:51:22 +00:00
Andrew Skiba f43e959572 revert unnecessary TARGET_JVM commit
svn path=/trunk/mcs/; revision=66183
2006-10-03 12:44:11 +00:00
Andrew Skiba 95ae5d78d3 TARGET_JVM
svn path=/trunk/mcs/; revision=66029
2006-09-28 13:41:05 +00:00
Gonzalo Paniagua Javier 601398134b 2006-02-24 Gonzalo Paniagua Javier <[email protected]>
* UnicastIPAddressInformation.cs:
	* PingException.cs:
	* TcpConnectionInformation.cs:
	* IPv4InterfaceStatistics.cs:
	* NetworkInformationException.cs:
	* IPAddressInformation.cs:
	* MulticastIPAddressInformationCollection.cs:
	* TcpStatistics.cs:
	* IPGlobalStatistics.cs:
	* NetworkInformationPermission.cs:
	* MulticastIPAddressInformation.cs:
	* IcmpV4Statistics.cs:
	* IcmpV6Statistics.cs:
	* IPv4InterfaceProperties.cs:
	* PhysicalAddress.cs:
	* IPv6InterfaceProperties.cs:
	* GatewayIPAddressInformationCollection.cs:
	* ChangeLog: Modified file.
	* UnicastIPAddressInformationCollection.cs:
	* IPAddressCollection.cs:
	* NetworkInformationPermissionAttribute.cs:
	* Ping.cs:
	* NetworkChange.cs:
	* IPAddressInformationCollection.cs:
	* UdpStatistics.cs:
	* GatewayIPAddressInformation.cs:
	* IPGlobalProperties.cs:
	* IPInterfaceProperties.cs:
	* NetworkInterface.cs: implemented or stubbed out.


svn path=/trunk/mcs/; revision=57264
2006-02-24 22:47:15 +00:00