473,387 Members | 1,897 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1442

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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.