R
Roland
Hello group,
I cannot make any HTTPRequest or WebClient using application run. I always
get an exception from somewhere inside System.Net.Sockets.Socket and cannot
figure out the reason.
In order to demonstrate the basic problem I just modified the
simplehelloworld example from .NET SDK 1.1 that way:
public class SimpleHelloWorld : Form {
[STAThread]
public static int Main(string[] args) {
if (args.Length < 2)
{
Console.WriteLine("Usage: downloadfile [localfile]");
return 0;
}
try
{
System.Net.WebClient client = new WebClient();
client.DownloadFile(args[0], args[1]);
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
};
return 0;
}
As you can see the main function now attempts so download a file. I found
this sample somewhere in the web. It is just to demonstrate to you that I
don't do anything strange and forbidden. The error is almost the same:
Unbehandelte Ausnahme: System.TypeInitializationException: Der
Typeninitialisierer für System.Net.Sockets.Socket hat eine Ausnahme
verursacht. ---> System.Net.Sockets.SocketException: Ein Socketvorgang
konnte nicht ausgeführt werden, da dem
System Pufferspeicher fehlte oder eine Warteschlange voll war
at System.Net.Sockets.Socket.InitializeSockets()
at System.Net.Sockets.Socket..cctor()
--- Ende der internen Ausnahmestapelüberwachung ---
at System.Net.Connection.StartConnectionCallback(Object state, Boolean
wasSignalled)
System.Net.WebException: Das Zeitlimit für den Vorgang wurde überschritten.
at System.Net.HttpWebRequest.GetResponse()
at System.Net.WebClient.DownloadFile(String address, String FileName)
at
Microsoft.Samples.WinForms.Cs.SimpleHelloWorld.SimpleHelloWorld.Main(String[
] args) in
e:\Programme\Microsoft.NET\SDK\v1.1\QuickStart\winforms\samples\simplehellow
orld\cs\simplehelloworld.cs:line 35
I'm quite sure that there is nothing wrong with the Winsock on my sytem
(Win2k Prof SP4), because I have a lot of socket based apps programmed,
either in C++ or Delphi and never had such a problem.
One thing is probably worth to mention: I have a lot of network adapters of
different kind in my system. Could that cause the problem?
Any pointer welcome
Roland
I cannot make any HTTPRequest or WebClient using application run. I always
get an exception from somewhere inside System.Net.Sockets.Socket and cannot
figure out the reason.
In order to demonstrate the basic problem I just modified the
simplehelloworld example from .NET SDK 1.1 that way:
public class SimpleHelloWorld : Form {
[STAThread]
public static int Main(string[] args) {
if (args.Length < 2)
{
Console.WriteLine("Usage: downloadfile [localfile]");
return 0;
}
try
{
System.Net.WebClient client = new WebClient();
client.DownloadFile(args[0], args[1]);
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
};
return 0;
}
As you can see the main function now attempts so download a file. I found
this sample somewhere in the web. It is just to demonstrate to you that I
don't do anything strange and forbidden. The error is almost the same:
Unbehandelte Ausnahme: System.TypeInitializationException: Der
Typeninitialisierer für System.Net.Sockets.Socket hat eine Ausnahme
verursacht. ---> System.Net.Sockets.SocketException: Ein Socketvorgang
konnte nicht ausgeführt werden, da dem
System Pufferspeicher fehlte oder eine Warteschlange voll war
at System.Net.Sockets.Socket.InitializeSockets()
at System.Net.Sockets.Socket..cctor()
--- Ende der internen Ausnahmestapelüberwachung ---
at System.Net.Connection.StartConnectionCallback(Object state, Boolean
wasSignalled)
System.Net.WebException: Das Zeitlimit für den Vorgang wurde überschritten.
at System.Net.HttpWebRequest.GetResponse()
at System.Net.WebClient.DownloadFile(String address, String FileName)
at
Microsoft.Samples.WinForms.Cs.SimpleHelloWorld.SimpleHelloWorld.Main(String[
] args) in
e:\Programme\Microsoft.NET\SDK\v1.1\QuickStart\winforms\samples\simplehellow
orld\cs\simplehelloworld.cs:line 35
I'm quite sure that there is nothing wrong with the Winsock on my sytem
(Win2k Prof SP4), because I have a lot of socket based apps programmed,
either in C++ or Delphi and never had such a problem.
One thing is probably worth to mention: I have a lot of network adapters of
different kind in my system. Could that cause the problem?
Any pointer welcome
Roland