473,473 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CannotUnloadAppDomainException

Hello Everybody

we are calling a Socket.SendTo( buffer, remote ) in a method in our Web
Service.
After doing this the Web Service won't stop any longer.

We get an System.CannotUnloadAppDomainException whenever we have called the
method mentioned above.

If we haven't called the method that opens a socket we can stop the
WebService without any problems.

See the code below and PLEASE help me :-)

public static ArrayList PingHost( Int32 lWaitTime )
{
//Initilize a Socket of the Type ICMP
socket = new Socket( AddressFamily.InterNetwork,
SocketType.Raw,
ProtocolType.Icmp );

......

nBytes = socket.SendTo( sendbuf,
PacketSize,
SocketFlags.None,
epServer );
if( nBytes == SOCKET_ERROR )
{
throw new Exception("Socket Error");
}

.......

while( System.Environment.TickCount < dwStart+lWaitTime )
{
if( socket.Poll( lWaitTime, SelectMode.SelectRead ) )
{
nBytes = socket.ReceiveFrom( ReceiveBuffer,
lLength,

SocketFlags.None,
ref
epServer );
}
}

.........

if( socket != null )
{
socket.Shutdown( SocketShutdown.Both );
socket.Close();
socket = null;
}
return RetVal;
}

Jul 21 '05 #1
0 1444

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: HKannen | last post by:
Hello Everybody we are calling a Socket.SendTo( buffer, remote ) in a method in our Web Service. After doing this the Web Service won't stop any longer. We get an...
1
by: rh | last post by:
hi, we just migrated to x64 and .net 2.0 and getting a debugger popup with the system.cannotunloadappdomainexception caused by w3wp.exe. it happens intermittently, and doesn't seem like it's...
3
by: lai_waiman | last post by:
Dear All, I have problems on doing some long lasting job in a web services. Let me first provide some background information first. I have a ASP.NET web page, which will call another Web...
0
by: Zeya | last post by:
Situation: Using C#, ASP.Net Requirement: 1. ASP.net application with virtual hosting service. 2. Requires a service that will run every predefined frequency in minutes (2, 30, 100, 10000)...
0
by: Mike Schilling | last post by:
Is there any way to list all the threads currently running for an AppDomain, or even for a process? That is, having caught a CannotUnloadAppDomainException telling you that some threads are...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.