473,503 Members | 10,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error from Dns.GetHostName

I get the following exception when calling Dns.GetHostName (from C#):
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred
in system.dll
Additional information: An operation on a socket could not be performed
because the system lacked sufficient buffer space or because a queue was
full

This exception is then followed with the following exception:
An unhandled exception of type 'System.TypeInitializationException' occurred
in system.dll
Additional information: The type initializer for "System.Net.Sockets.Socket"
threw an exception.

I'm running .net Framework1.1 on Win2k, on a laptop with a couple of
network adapters. I did some experiments to limit numbers of processes
running, stopped sql server etc... I removed the Netbeui protocol from the
adapter that is connected to the internet etc. I had some success with this
approach... the error disappeared for a couple of days, but is now back.

Any suggestions?
Jul 19 '05 #1
3 7301
Thomas,

I've seen something similar to what you're describing.

Does this happen when you run your program for some period of time or does
it happen immediately (right when you start it)?

Also, after you get the error, please run "netstat -a" from the command
line and see if you have a bunch of TCP ports that have a State of
"TIME_WAIT".

Thanks,
bliz

--
Jim Blizzard | http://weblogs.asp.net/jblizzard
Sr .NET Developer Evangelist
Microsoft

Your Potential. Our Passion.

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only, so that others may benefit. Thanks.
--------------------
From: "MSNews" <th***************@boeing.com>
Subject: Error from Dns.GetHostName
Date: Fri, 22 Aug 2003 14:30:52 -0700

I get the following exception when calling Dns.GetHostName (from C#):
An unhandled exception of type 'System.Net.Sockets.SocketException' occurredin system.dll
Additional information: An operation on a socket could not be performed
because the system lacked sufficient buffer space or because a queue was
full

This exception is then followed with the following exception:
An unhandled exception of type 'System.TypeInitializationException' occurredin system.dll
Additional information: The type initializer for "System.Net.Sockets.Socket"threw an exception.

I'm running .net Framework1.1 on Win2k, on a laptop with a couple of
network adapters. I did some experiments to limit numbers of processes
running, stopped sql server etc... I removed the Netbeui protocol from the
adapter that is connected to the internet etc. I had some success with thisapproach... the error disappeared for a couple of days, but is now back.

Any suggestions?


Jul 19 '05 #2
Hmmmm. The case I had occured after the program had been running for 30+
hours. It wasn't an immediate thing. There were 100s of ports open in
TIME_WAIT state when it finally failed.

Do you have some simple code you could post that reproduces the problem?

--
Jim Blizzard | http://weblogs.asp.net/jblizzard
Sr .NET Developer Evangelist
Microsoft

Your Potential. Our Passion.

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only, so that others may benefit. Thanks.
--------------------
Content-Class: urn:content-classes:message
From: "Tom P" <th***************@boeing.com>
Sender: "Tom P" <th***************@boeing.com>
References: <OI**************@TK2MSFTNGP09.phx.gbl> <qL**************@cpmsftngxa06.phx.gbl>Subject: RE: Error from Dns.GetHostName
Date: Sat, 23 Aug 2003 09:56:43 -0700

It happens immediately. I checked it right after a fresh
reboot, but after getting connected to the internet. I'm
using IPSEC to establish a tunnel into the Boeing intranet.
The error also occurs when connect inside the Boeing
intranet (while I'm at work vs at home).

Yes, there are several (20) channels in TIME_WAIT state.

There are between 40 and 50 channels that show up in the
status list.

Thanks for your help.

Tom
-----Original Message-----
Thomas,

I've seen something similar to what you're describing.

Does this happen when you run your program for some

period of time or does
it happen immediately (right when you start it)?

Also, after you get the error, please run "netstat -a"

from the command
line and see if you have a bunch of TCP ports that have a

State of
"TIME_WAIT".

Thanks,
bliz

--
Jim Blizzard | http://weblogs.asp.net/jblizzard
Sr .NET Developer Evangelist
Microsoft

Your Potential. Our Passion.

This posting is provided "AS IS" with no warranties, and

confers no rights.
Please reply to newsgroups only, so that others may

benefit. Thanks.


--------------------
From: "MSNews" <th***************@boeing.com>
Subject: Error from Dns.GetHostName
Date: Fri, 22 Aug 2003 14:30:52 -0700

I get the following exception when callingDns.GetHostName (from C#):An unhandled exception oftype 'System.Net.Sockets.SocketException'
occurred
in system.dll
Additional information: An operation on a socket could

not be performedbecause the system lacked sufficient buffer space orbecause a queue wasfull

This exception is then followed with the followingexception:An unhandled exception oftype 'System.TypeInitializationException'
occurred
in system.dll
Additional information: The type initializer for

"System.Net.Sockets.Socket"
threw an exception.

I'm running .net Framework1.1 on Win2k, on a laptop with

a couple ofnetwork adapters. I did some experiments to limitnumbers of processesrunning, stopped sql server etc... I removed the Netbeuiprotocol from theadapter that is connected to the internet etc. I hadsome success with
this
approach... the error disappeared for a couple of days,

but is now back.
Any suggestions?


.


Jul 19 '05 #3
I created the simplest of windows forms app, and put a
call to Dns.GetHostName(); in the constructor:
In form1 constructor:
Dns.GetHostName();

I tried some variations
IPHostEntry host = Dns.Resolve
(Environment.MachineName);

In fact, any static method on Dns will give the same
result. It appears to me that the static initializers in
Dns are failing, because if I catch the exception and then
follow up with another call to any Dns static, I get
slightly different behaviour in that the debugger doesn't
report an "uncaught exception in System.dll", but does
report the final exception:
The type initializer for "System.Net.Sockets.Socket" threw
an exception.

In my latest test, there were 0 sockets in the TIME_WAIT
state. There were a total of about 20 TCP sockets listed
in netstat -a. There were about 20 UDP sockets as well.

This result may indicate that there is something peculiar
with my system environment... combination of types of
devices/drivers and protocols that may be tripping up the
Dns initializer? One device I have installed is a Linksys
Combo PCMCIA Ethernet Adapter. I run NetBEUI to
communicate with a shop floor device on 10-baseT.
However, as an experiment, I tried disabling the device
and removing it from my system, and this did not clear up
the problem. Early last week, I had a positive result
with both network devices plugged in and communicating.

Could it be that plug-and-play, with the way in which
adapter numbers are not pre-determined may have laid out
the adapter order in a different sequence, and this leads
to pseudo-random failures?
-----Original Message-----
Hmmmm. The case I had occured after the program had been running for 30+hours. It wasn't an immediate thing. There were 100s of ports open inTIME_WAIT state when it finally failed.

Do you have some simple code you could post that reproduces the problem?
--
Jim Blizzard | http://weblogs.asp.net/jblizzard
Sr .NET Developer Evangelist
Microsoft

Your Potential. Our Passion.

This posting is provided "AS IS" with no warranties, and confers no rights.Please reply to newsgroups only, so that others may benefit. Thanks.

--------------------
Content-Class: urn:content-classes:message
From: "Tom P" <th***************@boeing.com>
Sender: "Tom P" <th***************@boeing.com>
References: <OI**************@TK2MSFTNGP09.phx.gbl>

<qL**************@cpmsftngxa06.phx.gbl>
Subject: RE: Error from Dns.GetHostName
Date: Sat, 23 Aug 2003 09:56:43 -0700

It happens immediately. I checked it right after a freshreboot, but after getting connected to the internet. I'musing IPSEC to establish a tunnel into the Boeing intranet.The error also occurs when connect inside the Boeing
intranet (while I'm at work vs at home).

Yes, there are several (20) channels in TIME_WAIT state.

There are between 40 and 50 channels that show up in the
status list.

Thanks for your help.

Tom
-----Original Message-----
Thomas,

I've seen something similar to what you're describing.

Does this happen when you run your program for some

period of time or does
it happen immediately (right when you start it)?

Also, after you get the error, please run "netstat -a"

from the command
line and see if you have a bunch of TCP ports that have
aState of
"TIME_WAIT".

Thanks,
bliz

--
Jim Blizzard | http://weblogs.asp.net/jblizzard
Sr .NET Developer Evangelist
Microsoft

Your Potential. Our Passion.

This posting is provided "AS IS" with no warranties,
andconfers no rights.
Please reply to newsgroups only, so that others may

benefit. Thanks.


--------------------
From: "MSNews" <th***************@boeing.com>
Subject: Error from Dns.GetHostName
Date: Fri, 22 Aug 2003 14:30:52 -0700

I get the following exception when calling

Dns.GetHostName (from C#):
An unhandled exception of

type 'System.Net.Sockets.SocketException'
occurred
in system.dll
Additional information: An operation on a socket could

not be performed
because the system lacked sufficient buffer space or

because a queue was
full

This exception is then followed with the following

exception:
An unhandled exception of

type 'System.TypeInitializationException'
occurred
in system.dll
Additional information: The type initializer for
"System.Net.Sockets.Socket"
threw an exception.

I'm running .net Framework1.1 on Win2k, on a laptop
witha couple of
network adapters. I did some experiments to limit

numbers of processes
running, stopped sql server etc... I removed the
Netbeuiprotocol from the
adapter that is connected to the internet etc. I had

some success with
this
approach... the error disappeared for a couple of
days,but is now back.

Any suggestions?


.


.

Jul 19 '05 #4

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

Similar topics

0
5994
by: Eric Brunel | last post by:
Hi all, I just compiled Python 2.3.2 on Linux Mandrake 8.0, upgrading from Python 2.1. I have one problem that I can't figure out: when I wanted to get "the" IP address of the current host with...
2
2204
by: John Ky | last post by:
Hello: Building Python works fine. Now I am trying to build my own python module on Solaris 9, but I'm getting the following conflict: In file included from...
13
6572
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
7
4977
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
4
436
by: MSNews | last post by:
I get the following exception when calling Dns.GetHostName (from C#): An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in system.dll Additional information: An...
2
1135
by: iwdu15 | last post by:
hi, im writing a program with multiple threads, and in one of the secondary threads, i need to access the main form...but the code i wrote throws errors saying i cant do this. is there anyway i can...
6
2828
by: Cottonwood | last post by:
I have a problem to retrieve th hostname of my pc. I'm using Windows XP SP2 with the last updates and GNU Dev C++ 4.9.9.2. Here my little test program: #include <winsock2.h> #include <unistd.h>...
2
2053
by: seb | last post by:
Hi, this simple server (time protocol) does not respond after a few hours, even when it is restarted. The behaviour looks to me like a firewall blocking but I have desabled the firewall. Using...
10
4286
by: 7stud | last post by:
Hi, I'm experimenting with a basic socket program(from a book), and both the client and server programs are on my computer. In both programs, I call socket.gethostname(), but I discovered that...
2
19396
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
7067
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7316
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...
1
6975
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
7449
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...
1
4992
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
3160
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
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
371
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.