Error Performing Socket Operations
not be performed because the system lacked sufficient buffer space or because a queue was full.” ★★★★★★★★★★★★★★★ SQL Server ConnectivityMarch 9, 20096 0 0 0 This error message, which is associated with the Winsock error WSAENOBUFS and actually comes from Windows rather than SQL Server directly, has two well-understood root causes.However, it still stumps people today, probably because there is no single source which explains both root causes and offers solutions for both. Here is a description of the two common situations where you may see this error and quick solutions for each:
OS runs out of memory for TCP buffers When a powerful client machine, especially one with lots of RAM, is running an x86 version of Windows, people use the /PAE switch in the c:boot.ini file to allow applications on that machine to be able to address the full range of memory. One other switch often used to give more memory to applications is the /3gb switch in the boot.ini file. The problem comes when these two are combined: the /3gb switch gives more memory to applications by reducing the amount of memory available to the OS. When it is used on a powerful machine where the applications require many OS resources, such as by opening many TCP connections, this can cause the OS to run out of memory for resources like TCP buffers. When that happens, Winsock throws the error WSAENOBUFS. Solution: Remove the /3gb switch from c:boot.ini. The root problem in this case is memory pressure on the OS, so removing the /3gb switch will give more memory to the OS and will alleviate this problem. OS runs out of available TCP “ephemeral” ports When the client machine is opening many TCP connections and is running Windows Server 2003, Windows XP, or any earlier version of Windows, it may run out of TCP “ephemeral” ports. In Windows Server 2003, Windows XP, and earlier versions, Windows limits the number of available ephemeral ports to approximately 5000 across the machine. It is especially common to hit this problem for applications which do not use connection pooling. Solution: To make more ephemeral ports available, follow the directions in this KB which describe how to create the MaxUserPort registry key: http://support.microsoft.com/kb/196271 Dan BenediktsonSQL Server ProtocolsDisclaimer: This posting is provided "AS IS" with no warranties, andsend I sometimes receive a “Socket operation on a non-socket” error The “Socket operation on a non-socket” error means that, for some reason, the Windows TCP-IP stack has been overloaded, and the socket channel (which is used for communicating with the Internet) has been shut down abruptly. This error may have a lot of causes, which usually require a good network analysis and networking skills in order to be tracked down. But most of the times this is just a temporary error which will be solved simply restarting Windows. If the error repeats, here are some hints: Before launching https://blogs.msdn.microsoft.com/sql_protocols/2009/03/09/understanding-the-error-an-operation-on-a-socket-could-not-be-performed-because-the-system-lacked-sufficient-buffer-space-or-because-a-queue-was-full/ a mailing close all other programs and processes, expecially those who need internet access Temporarily disable your firewall, antivirus and other Internet security programs As a test, in order to track down timing problems on the network, configure SendBlaster’s “Send” settings to use just 1 connection and set a pause of 5 seconds between messages (if it works, you will gradually increase speed later) http://www.sendblaster.com/en/support/error-trapping/socket-operation-a-non-socket-error Perform a system scan and make sure that no spywares, trojans or other malware are running (they may be silently having Internet access) Update drivers for all network gear (modems, routers, USB dongles) If you are on a wireless connection, make sure the connection is good and stable Apply Windows updates if any are available If you are using an Smtp server, check that it is working (you may have to ask your ISP) As a last resort, install SendBlaster on another PC connected to the same local network (this way you will be able to check whether the issue is coming from your PC or from the network) As this is a network-related problem, you may find additional information performing a search on a search engine with “socket operation on a non-socket” keywords. Chat Support Talk with our marketing experts Search Contacts Support Permission based list Importing lists Managing lists Create newsletters Video tutorials SMTP and sending issues Spam issues Email tracking Suggestions Error trapping Trouble Ticket (Support) Email marketing tutorial: Importing lists How to create a permission based list Guide for a better e-mail marketing Anti-Spam
using the inbuilt socket modules in Perl. Perl socket modules provides an object interface that makes it easier to create and use TCP / UPD sockets. This article covers http://www.thegeekstuff.com/2010/07/perl-tcp-udp-socket-programming the following topics: Perl example code for TCP client and server Perl example code for UDP client and server Read and write descriptor list using Select(IO::Select) CPAN module IO::Socket::INET is used to perform socket operations such as -- creating, binding, connecting, listening and closing the socket. IO::Select module is used for obtaining the descriptors that are ready for read/write operations. Perl TCP Client and Server TCP is a error performing connection oriented networking protocol. In this example, let us review the Perl code-snippet that will explaining us the simple client and server communication. Perl TCP Server Operation The socket operation such as socket creation, binding and listening to the socket is performed by the IO::Socket::INET module. The Perl code given below does the following: Create the Socket Bind the socket to an address and port Listen to the error performing socket socket at the port address Accept the client connections Perform read/write operation on the socket. #!/usr/bin/perl #tcpserver.pl use IO::Socket::INET; # flush after every write $| = 1; my ($socket,$client_socket); my ($peeraddress,$peerport); # creating object interface of IO::Socket::INET modules which internally does # socket creation, binding and listening at the specified port address. $socket = new IO::Socket::INET ( LocalHost => '127.0.0.1', LocalPort => '5000', Proto => 'tcp', Listen => 5, Reuse => 1 ) or die "ERROR in Socket Creation : $!\n”; print "SERVER Waiting for client connection on port 5000"; while(1) { # waiting for new client connection. $client_socket = $socket->accept(); # get the host and port number of newly connected client. $peer_address = $client_socket->peerhost(); $peer_port = $client_socket->peerport(); print “Accepted New Client Connection From : $peeraddress, $peerport\n ”; # write operation on the newly accepted client. $data = “DATA from Server”; print $client_socket “$data\n”; # we can also send the data through IO::Socket::INET module, # $client_socket->send($data); # read operation on the newly accepted client $data = <$client_socket>; # we can also read from socket through recv() in IO::Socket::INET # $client_socket->recv($data,1024); print “Received from Client : $data\n”; } $socket->close(); Also, refer to our earlier Perl debugger article to learn how to debug your pe