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

D

Dmitriy Zakharov

Sorry for reposting. This one contains real email address.


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
 
Y

Yan-Hong Huang[MSFT]

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: Repost: Unexpected Socket Error (WSAENOBUFS) on Windows XP / .NET 1.1
!Date: Tue, 19 Aug 2003 22:31:42 -0400
!Lines: 42
!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!tk2msftngp13.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.sdk:7192 microsoft.public.dotnet.framework:51664
!X-Tomcat-NG: microsoft.public.dotnet.framework
!
!> Sorry for reposting. This one contains real email address.
!
!
!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
!
!
!
!
 
B

Bill Newman

Hello -

I've been working with Dmitriy on this problem. We tried
the registry entries below, increasing the values each
time until they were about 300% of the original. Still no
luck.

Any other ideas?

Thanks!

Bill Newman
-----Original Message-----
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.
 
Y

Yan-Hong Huang[MSFT]

Hello Bill,

According to Dmitriy's description, the problem only happens to some
machines. I think this may be related to some software setting. Did you
check those machines to see whether they install some special software,
such as antivirus tool and etc. If so, is it convenient for you to
disable/uninstall them for testing? It is better for us to test on a clean
machine to make sure that it won't be caused by some unexpected factors.

Thanks.

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.

--------------------
!Content-Class: urn:content-classes:message
!From: "Bill Newman" <[email protected]>
!Sender: "Bill Newman" <[email protected]>
!References: <[email protected]>
<[email protected]>
!Subject: RE: Repost: Unexpected Socket Error (WSAENOBUFS) on Windows XP /
.NET 1.1
!Date: Wed, 10 Sep 2003 12:29:54 -0700
!Lines: 127
!Message-ID: <[email protected]>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Thread-Index: AcN30elt3X1czlRPQXq8qcKDWF68Kw==
!Newsgroups: microsoft.public.dotnet.framework
!Path: cpmsftngxa06.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework:53407
!NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
!X-Tomcat-NG: microsoft.public.dotnet.framework
!
!Hello -
!
!I've been working with Dmitriy on this problem. We tried
!the registry entries below, increasing the values each
!time until they were about 300% of the original. Still no
!luck.
!
!Any other ideas?
!
!Thanks!
!
!Bill Newman
!>-----Original Message-----
!>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: Repost: Unexpected Socket Error (WSAENOBUFS) on
!Windows XP / .NET 1.1
!>!Date: Tue, 19 Aug 2003 22:31:42 -0400
!>!Lines: 42
!>!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.f
!ramework.sdk
!>!NNTP-Posting-Host: 206.116.48.3
!>!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!
!tk2msftngp13.phx.gbl
!>!Xref: cpmsftngxa06.phx.gbl
!microsoft.public.dotnet.framework.sdk:7192
!microsoft.public.dotnet.framework:51664
!>!X-Tomcat-NG: microsoft.public.dotnet.framework
!>!
!>!> Sorry for reposting. This one contains real email
!address.
!>!
!>!
!>!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
!>!
!>!
!>!
!>!
!>
!>
!>.
!>
!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top