Unexpected Socket Error (WSAENOBUFS) on Windows XP / .NET 1.1

  • Thread starter Thread starter Dmitriy Zakharov
  • Start date Start date
D

Dmitriy Zakharov

Hi all,

I'm running the following program (see below), which tests connection to the
Microsoft FTP Site (207.46.133.140:21)

On several of our client's Windows XP machines, it generates WSAENOBUFS
error:
"An operation on a socket could not be performed because the system lacked
sufficient buffer space or because a queue was full."

While this code throws exception, Internet Explorer and FTP utility connect
fine. Is it possible to make this work in the framework? We cannot rewrite
our application now for Win32.

------------------- Module1.vb
Imports System.Net
Imports System.Net.Sockets
Public Class mySocket
Public Overloads Shared Sub Main()
Try
Dim s As Socket = New Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.IP)
s.Connect(New IPEndPoint(IPAddress.Parse("207.46.133.140"), 21))
s.Close()
MsgBox("OK")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class
------------------------------

Thanks.
Dmitriy Zakharov.
Tritech Financial Systems, Inc.
(416) 621-2020
 
Hello Dmitriy,

Thanks for posting in the group.

It's very possible that you really have run out of memory allocated for network communications. Please add some memory
on the system to see if the problem still exists.

Also you could try the following:

In the registry at:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters\Winsock

add 3 new DWORD entries:

InitialLargeBufferCount
InitialMediumBufferCount
InidialSmallBufferCount

Give them values of 10, 30, and 50 respectively. If this doesn't help, try bumping them up by about 10% each a few times.
Please note that you may need to reboot NT after changing any of these before they will take effect.

Hope that helps.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!From: "Dmitriy Zakharov" <[email protected]>
!Subject: Unexpected Socket Error (WSAENOBUFS) on Windows XP / .NET 1.1
!Date: Tue, 19 Aug 2003 22:26:02 -0400
!Lines: 38
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Message-ID: <[email protected]>
!Newsgroups: microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.sdk
!NNTP-Posting-Host: 206.116.48.3
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.sdk:7191 microsoft.public.dotnet.framework:51663
!X-Tomcat-NG: microsoft.public.dotnet.framework
!
!Hi all,
!
!I'm running the following program (see below), which tests connection to the
!Microsoft FTP Site (207.46.133.140:21)
!
!On several of our client's Windows XP machines, it generates WSAENOBUFS
!error:
!"An operation on a socket could not be performed because the system lacked
!sufficient buffer space or because a queue was full."
!
!While this code throws exception, Internet Explorer and FTP utility connect
!fine. Is it possible to make this work in the framework? We cannot rewrite
!our application now for Win32.
!
!------------------- Module1.vb
!Imports System.Net
!Imports System.Net.Sockets
!Public Class mySocket
!Public Overloads Shared Sub Main()
!Try
!Dim s As Socket = New Socket(AddressFamily.InterNetwork, SocketType.Stream,
!ProtocolType.IP)
!s.Connect(New IPEndPoint(IPAddress.Parse("207.46.133.140"), 21))
!s.Close()
!MsgBox("OK")
!Catch ex As Exception
!MsgBox(ex.ToString)
!End Try
!End Sub
!End Class
!------------------------------
!
!Thanks.
!Dmitriy Zakharov.
!Tritech Financial Systems, Inc.
!(416) 621-2020
!
!
!
 
Back
Top