linux-packaging-mono/mono/tests/appdomain-unload-doesnot-raise-pending-events.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

30 lines
729 B
C#

using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading;
class Driver {
static void AppDomainMethod () {
Console.WriteLine ("two");
var socket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint ep = new IPEndPoint(IPAddress.Any, 0);
socket.Bind (ep);
socket.Listen (10);
socket.BeginAccept ( delegate {
Console.WriteLine ("Delegate should not be called!");
Environment.Exit (1);
}, socket);
}
static int Main () {
var da = AppDomain.CreateDomain ("le domain");
da.DoCallBack (delegate { AppDomainMethod ();});
Console.WriteLine ("unloading");
AppDomain.Unload (da);
Console.WriteLine ("done");
return 0;
}
}