Author: arina
Date: 2007-12-20 09:30:11 -0500 (Thu, 20 Dec 2007)
New Revision: 91709
Modified:
trunk/mcs/class/System/System.Net.Sockets/GHStreamSocket.jvm.cs
trunk/mcs/class/System/System.Net.Sockets/Socket.jvm.cs
trunk/mcs/class/System/Test/System.Net.Sockets/TcpClientTest.cs
Log:
Fix for 9491 bug. Socket should not throw exception when it closed by another
thread.
Modified: trunk/mcs/class/System/System.Net.Sockets/GHStreamSocket.jvm.cs
===================================================================
--- trunk/mcs/class/System/System.Net.Sockets/GHStreamSocket.jvm.cs
2007-12-20 14:00:13 UTC (rev 91708)
+++ trunk/mcs/class/System/System.Net.Sockets/GHStreamSocket.jvm.cs
2007-12-20 14:30:11 UTC (rev 91709)
@@ -1,8 +1,6 @@
-using System;
-using System.Net;
-using javax.net;
+using java.nio.channels;
+using java.security;
using javax.net.ssl;
-using java.security;
namespace System.Net.Sockets
{
@@ -205,6 +203,9 @@
return new GHStreamSocket(acceptedSocket);
}
+ catch (AsynchronousCloseException) {
+ error = 10004;
+ }
catch (Exception e)
{
error = 10061; //WSAECONNREFUSED (Connection
refused)
@@ -374,6 +375,9 @@
{
error = 10041; //WSAEPROTOTYPE (Protocol wrong
type for socket)
}
+ catch (AsynchronousCloseException) {
+ error = 10004;
+ }
catch (Exception e)
{
error = 10061; //WSAECONNREFUSED (Connection
refused)
Modified: trunk/mcs/class/System/System.Net.Sockets/Socket.jvm.cs
===================================================================
--- trunk/mcs/class/System/System.Net.Sockets/Socket.jvm.cs 2007-12-20
14:00:13 UTC (rev 91708)
+++ trunk/mcs/class/System/System.Net.Sockets/Socket.jvm.cs 2007-12-20
14:30:11 UTC (rev 91709)
@@ -31,18 +31,11 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
-using System.Net;
using System.Collections;
-using System.Runtime.CompilerServices;
+using System.Collections.Generic;
+using System.Net.Configuration;
using System.Runtime.InteropServices;
using System.Threading;
-using System.Reflection;
-using System.IO;
-using System.Net.Configuration;
-#if NET_2_0
-using System.Collections.Generic;
-#endif
namespace System.Net.Sockets
{
@@ -737,8 +730,6 @@
{
get
{
- EnsureStillUsable();
-
return(blocking);
}
set
@@ -1019,7 +1010,6 @@
}
#endif
- Thread blocking_thread;
public Socket Accept()
{
EnsureStillUsable();
@@ -1030,18 +1020,7 @@
#else
GHSocket sock = null;
#endif
- blocking_thread = Thread.CurrentThread;
- try {
- sock = Accept_internal(socket, out error);
- } catch (ThreadAbortException the) {
- if (disposed) {
- Thread.ResetAbort ();
- error = 10004;
- }
- } finally {
- blocking_thread = null;
- }
-
+ sock = Accept_internal(socket, out error);
if (error != 0) {
throw new SocketException (error);
}
@@ -1382,24 +1361,11 @@
int error = 0;
- blocking_thread = Thread.CurrentThread;
- try {
#if !TARGET_JVM
Connect_internal (socket,
remote_end.Serialize(), out error);
#else
Connect_internal (socket, remote_end, out
error);
#endif
- }
- catch (ThreadAbortException the)
- {
- if (disposed) {
- Thread.ResetAbort ();
- error = 10004;
- }
- } finally {
- blocking_thread = null;
- }
-
if (error != 0) {
throw new SocketException (error);
}
@@ -2359,11 +2325,6 @@
GHSocket x = socket;
socket = null;
Close_internal (x, out error);
- if (blocking_thread != null)
- {
- blocking_thread.Abort ();
- blocking_thread = null;
- }
if (error != 0)
throw new SocketException (error);
Modified: trunk/mcs/class/System/Test/System.Net.Sockets/TcpClientTest.cs
===================================================================
--- trunk/mcs/class/System/Test/System.Net.Sockets/TcpClientTest.cs
2007-12-20 14:00:13 UTC (rev 91708)
+++ trunk/mcs/class/System/Test/System.Net.Sockets/TcpClientTest.cs
2007-12-20 14:30:11 UTC (rev 91709)
@@ -73,9 +73,6 @@
}
[Test] // bug #81105
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void CloseTest ()
{
IPEndPoint localEP = new IPEndPoint
(IPAddress.Loopback, 8765);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches