Error when constructing TcpClient : Error ...the system lacked insufficient buffer space or because

  • Thread starter Thread starter Sagaert Johan
  • Start date Start date
S

Sagaert Johan

i get this error if i write this :

using System.Net.Sockets;

....

....
TcpClient tcp;
tcp=new TcpClient();



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


Any hints ?
 
Sagaert Johan said:
i get this error if i write this :

using System.Net.Sockets;

...

...
TcpClient tcp;
tcp=new TcpClient();



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


Any hints ?
When creating a simple Socket i got something similar , i guess something is
wrong on my system

Socket sok;

sok=new
Socket(System.Net.Sockets.AddressFamily.InterNetwork,System.Net.Sockets.Sock
etType.Stream,System.Net.Sockets.ProtocolType.Tcp);

Yields this runtime error

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

when i hit continue, this one pops up

An unhandled exception of type 'System.TypeInitializationException' occurred
in WindowsApplication4.exe

Additional information: The type initializer for "System.Net.Sockets.Socket"
threw an exception.
 
Sagaert -

Have you checked to make sure the program has the proper security
settings to allow access to Sockets? Be careful when running network
programs from a shared network drive, or from accounts that do not
have the appropriate system priviledges. Hope this helps shed some
light on your problem.

Rich Blum - Author
"C# Network Programming" (Sybex)
http://www.sybex.com/sybexbooks.nsf/Booklist/4176
"Network Performance Open Source Toolkit" (Wiley)
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0471433012.html
 
Back
Top