Commit Graph
323 Commits
Author SHA1 Message Date
michaldobrodenka 7174b069cf Fix for ObjectDiposedException in DispatcherCB class
https://bugzilla.xamarin.com/show_bug.cgi?id=23700
2014-10-27 13:28:59 +01:00
Kei Nakazawa dc30595ace [System] Added missing ctor to Socket for initializing dual-mode socket
- Ref: https://bugzilla.xamarin.com/show_bug.cgi?id=20048
 - Mono currently doesn't support 2-args Socket ctor added in .NET 4.5
 - Absence of this ctor prevents KestrelHttpServer (web server for
   ASP.NET vNext: https://github.com/aspnet/KestrelHttpServer ) test
   code from working
 - I hesitated to put IPv4 only implementation, but full dual stack
   (IPv4/v6) support would need bunch of works to be done. So, I pinned
   supported protocol of new ctor to IPv4. Also, I filed v4/v6 support
   issue as a MonoTODO entry inside the source code.
2014-10-26 02:57:22 +09:00
Alexander Köplinger 48e112d652 [Cleanup] Removed TARGET_JVM
It was once part of a special Java target profile, but this is no longer used today.
2014-08-08 03:28:34 +02:00
Alexander Köplinger a8b2f07578 [Cleanup] Removed .jvm.cs files that are no longer used
They were once part of a special Java target profile, but this is no longer used today.
2014-08-07 23:01:51 +02:00
Miguel de Icaza 630116d1b6 Merge pull request #1142 from edbprx/master
ConnectCallback needs to call EndConnect
2014-07-09 09:21:37 -04:00
Ed Boren 0c55c45450 ConnectCallback needs to call EndConnect
Socket.ConnectAsync uses BeginConnect, and ends here in
ConnectCallback. It needs to call EndConnect so any error can be
propagated up.

See Xamarin bug: https://bugzilla.xamarin.com/show_bug.cgi?id=21017
2014-07-07 13:25:51 -04:00
Ivo Smits 0e2f0a23b6 Fixed NullReferenceExcepton in Socket.Connect for non-IP endpoints
Socket.Connect(EndPoint) throws a NullReferenceException when connecting to non-IP (eg Unix) endpoints in Dgram mode.
2014-06-24 00:21:06 +02:00
Tom Philpot 323255c174 Include inner exception when BeginWrite fails due to exception from Socket.BeginSend. 2014-05-07 09:48:31 -07:00
Robert Pickering fb2f5e0a2f Allow .NET 4.0 + users to use the ConnectSocket property 2014-04-24 07:34:27 +02:00
Jonathan Gagnon b699b14b06 Fixes a socket leak in class TcpListener
Fixes a socket leak in TcpListener.AcceptTcpClient and
TcpListener.EndAcceptTcpClient.
2014-01-27 09:18:10 -05:00
Andrés G. Aragoneses bd964bab4b [System] Change S.N.S.NetworkStream's param name on ctor
Changed to the name that is used in MS.NET:
http://msdn.microsoft.com/en-us/library/te7e60bx%28v=vs.110%29.aspx

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=16832
2013-12-17 23:09:22 +01:00
Rodrigo Kumpera 89d5527369 Merge pull request #600 from tr8dr/master
Fix for bug 9250 (critical bug for embedded mono)
2013-07-21 12:21:29 -07:00
Andres G. Aragoneses 67f528d7bb [Socket] Improve exception message when timing out in Socket.cs
This uses now the same exception message as MS.NET.
2013-04-08 10:42:42 +01:00
Andres G. Aragoneses 2ee016a7a6 [Socket] Refactor Socket to make Receive(_) call Receive(_,_)
After previous commit, two Receive() overloads are basically the same, so
we can remove some duplicated code here by making one call the other one.
2013-04-08 10:41:56 +01:00
Andres G. Aragoneses 55c7e30b1e [Socket] Specify 'timeout' in the exception msg of Receive(buf)
In the same way the overload Receive (buf, flags) already does, mention
"time out" in the exception message when the socketError is WOULDBLOCK and
the socket is not non-blocking (otherwise it would throw with the reason
"Operation on non-blocking socket would block", which doesn't make sense
for a socket that is not non-blocking).
2013-04-08 10:41:18 +01:00
Jonathan Shore e6b8be8cba minor fix for bug 9520:
- socket configuration attempts to determine if system supports ipv6
- checks app configuration, but configuration throws exception if called from embedded context
- solution is to put a try/catch guard and fall to an alternative test for ipv6
2013-03-16 11:34:59 -04:00
Torello Querci 0624fa42f1 Fix for bug 10233 about Socket.BeginSendFile 2013-03-01 14:30:04 +01:00
Rodrigo Kumpera f378e23a3f Since NET_2_1 implies NET_4_* now, take this into account and simplify our ifdefs. 2013-02-11 18:41:51 -05:00
Rodrigo Kumpera 5007c14d62 Kill the MOONLIGHT define in System. 2013-02-11 13:01:11 -05:00
Miguel de Icaza f0550b472a NetworkStream: Bring ReceiveTimeout, SendTimeout, Close to MOBILE profile 2012-11-07 13:21:29 -05:00
Paolo Molaro 452aaf4e5b Fixes xambug#2965: enqueue the correct worker instance (change from Tammo Hinrichs). 2012-08-02 18:10:23 +02:00
Rodrigo Kumpera a518a41512 Make the thread abort code multi-thread safe. 2012-06-27 19:59:57 -03:00
Rodrigo Kumpera 956dba9d5c With Socket:Dispose from using Thread.Abort to less agressive alternative.
* Socket_2_1.cs: When closing a socket we need to abort any
	pending syscalls to that socket. For most syscalls the kernel
	does it for us. But accept/connect on linux requires extra
	love.

	We previously used Thread.Abort to implement that, but this
	is a pretty radical solution with very complicated ramifications.
	So instead now we use a new icall cancel_blocking_socket_operation
	that makes sure we only abort the syscall and do nothing else.

	This reduces the trouble surface a lot given how tricky
	Thread.Abort is.
2012-06-27 19:59:56 -03:00
Martin Baulig eb0ef90fc4 Fix async sockets: don't set Count=0 when reusing SocketAsyncEventArgs.
This reverts commit e2e44bf6f4 (from May
2011).

Added SocketAsyncTest.cs to test this.
2012-06-19 01:10:12 +02:00
Marek Safar d5d4b9c22b Fix some warnings 2012-06-08 12:48:08 +01: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
Miguel de Icaza ae0feab435 Removal of NET_1_1 defines and some NET_2_0; Both defines are true these days in Mono, no versions prior to 2.0 are supported 2012-06-01 18:04:24 -04:00
Duncan Mak 20bf543db3 Add missing semicolon to fix the build. 2012-04-30 00:28:42 -04:00
JamesB7 23df5e1d5b Fixed a typo and a whitespacing mistake.
Also made CheckRange more descriptive - no performance loss since the conditions were ORed before and so both got checked anyway.
2012-04-29 19:40:38 -03:00
JamesB7 d9d66c6465 Finished making the changes.
There are two types of checks that were being done before:
(1) offset < 0? size < 0? offset + size > buffer.Length? This is trivial to get around. If I make both offset and size positive but have the sum overflow, it will pass all three checks.

(2) offset in range? size in range? If the buffer is very large this might run into overflow issues with its checking, though fine most of the time...

Is the offset in range? And is the size in range against buffer.Length - offset (which we know to be >= 0 from the earlier offset check)? This method of bounds checking is not in any danger from two's complement overflows.
2012-04-29 19:34:47 -03:00
JamesB7 c03eccac3c Fix for two's complement overflow. Doing it just for BeginReceive first in case GitHub's code editor screws up again. 2012-04-29 19:15:14 -03:00
Gonzalo Paniagua Javier 70c64f12c3 Fix multiple async accepts
Running multiple BeginAccepts or AcceptAsync at the same time on the
	same socket requires serialization.
	Fixes bug #3805.
2012-03-08 14:32:49 -05:00
Gonzalo Paniagua Javier 1f58521e21 ReadTimeout and WriteTimeout
They were returning a 0 timeout when it should be Infinite.
2012-03-08 14:32:48 -05:00
Marek Safar 2869713c48 Fix some compiler warnings 2012-02-17 12:37:25 +00:00
QuickJack 215fca80b8 Fixes a warning in System.dll 2011-12-27 19:05:28 +01:00
Martin 6e9b58656b Removes warning CS0219 in line 1647 2011-12-02 14:43:46 +01:00
Marek Safar c68fa87950 Add async methods to System.Net.Sockets 2011-10-07 10:11:28 +01:00
Marek Safar 1f9b71ab9f Remove ifdefs and fix argument names 2011-10-07 10:11:28 +01:00
Gonzalo Paniagua Javier c160422cd3 Merge pull request #167 from konrad-kruczynski/send_async_fix
Fix for Xamarin bug #531.
2011-09-29 08:30:47 -07:00
Gonzalo Paniagua Javier b96b00cb9d Internal worker is kept while there is an ongoing operation
When there is an ongoing operation we can't dispose the internal
	worker because it might be used by the IO threadpool.

	Fixes Novell bug #691076 and Xamarin bug #766.
2011-09-13 00:01:38 -04:00
Konrad M. Kruczynski c8d9d4355b Also zeroing in case of exception. 2011-08-30 19:43:46 +02:00
Konrad M. Kruczynski 9c42017230 Fix for bug #531 as proposed by aldem. 2011-08-30 19:38:03 +02:00
Konrad M. Kruczynski 5cf1cb6a13 Revert "Fix for Xamarin bug #531" - it will be fixed another way.
This reverts commit d1d1dd6198.
2011-08-30 18:57:47 +02:00
Konrad M. Kruczynski d1d1dd6198 Fix for Xamarin bug #531. 2011-08-30 02:05:21 +02:00
Bassam Tabbara 1d51e7ac60 Networkstream now throws IOException('connection closed') if the socket was closed/disposed 2011-08-07 23:17:19 -07:00
XTZGZoReX a552981293 Socket: Fixed a security issue when default-initialized ArraySegment structs are passed in.
This is the same security issue that was recently addressed in MS.NET.
2011-06-20 01:02:00 +02:00
ualtinok cef86e8e61 Made Count setter internal ->
Set Count to 0 as well as BytesTransferred when reusing a SocketAsyncEventArgs
2011-05-04 07:44:55 -07:00
ualtinok e2e44bf6f4 Set Count to 0 as well as BytesTransferred when reusing a SocketAsyncEventArgs. 2011-05-04 07:41:44 -07:00
Sebastien Pouliot e2f43dd7d5 Fix remaining moon-unit failures wrt Sockets changes
* System.Net.Sockets/Socket_2_1.cs: Ensure RemoteEndPoint is always
available after ConnectAsync (connected or not, allowed or not).
Ensure the Connect event is fired even if denied by policy.
2011-04-28 17:24:49 -04:00
Sebastien Pouliot 05cea06947 Fix copy-paste error in git 17085447
* System.Net.Sockets/Socket_2_1.cs: Fix some moved code (from
SocketAsyncEventArgs.cs) so should the references to RemoteEndPoint
still point to the SocketAsyncEventArgs instance. Fix some moon-unit
test failures
2011-04-28 17:24:49 -04:00