A socket error, such as socket error 10051, occurs whenever one computer attempts to connect to another network or server. Error 10051 happens because the other network is unreachable, usually because there is a problem with the router or modem on the computer attempting the connection. This can be as harmless as the router being shut off or a firewall getting in the way. At the serious end of the spectrum, the router may be misconfigured or may have been destroyed and is nonfunctioning.
Whenever a connection cannot be made, such as in the case of socket error 10051, one of the most common culprits is a firewall program. Though made to keep the computer safe, a firewall may restrict friendly connections. One should disable the firewall and see if the connection can go through. If the socket error still appears, then the firewall is not at fault.

If the router or modem is down, then there is no way for the computer to connect to another server. Someone may have bumped into the router or meant to reset the router and never turned it back on. Turning the router back on should restore the Internet server and allow the computer to connect to a server. If the router has been damaged, by being hit or having liquid spilled on it, for example, the router may need to be completely replaced.
A misconfigured router can cause socket error 10051. The misconfiguration means the router believes it cannot communicate with the server, so it doesn’t attempt the connection. Some advanced users may be able to find the problem, but it is best to call the Internet provider and get someone there to check out the router configuration. The provider will be able to find the problem and will tell the user how to fix it.
Some users have more than one router active at the same time. If there is more than one, one portion of the computer may believe it has to talk with one router, while another section believes another router has to be used. In this instance, neither router is designated as the primary router so neither will work. Configuring the computer to speak with only one router will alleviate this problem.
A similar problem that some users believe can cause socket error 10051 is when the computer is told not to use any router. This would cause the network to be unreachable, but it yields a different socket error. When the computer doesn’t have any router configured, this returns a socket error 10065.
I get an 10051 socket error every time I try to use this code:
USES_CONVERSION;
LPTSTR addr = A2W("192.168.1.209");
m_pSMACLPRCli = new CSMACLPRCli(addr, 12010, m_hWnd);
m_pSMACLPRCli->StartThread();
This is the constructor for m_pSMACLPRCli:
CSMACLPRCli::CSMACLPRCli(LPTSTR lpsztIPAddress, int nPort, HWND hParentWnd)
And this is how I create the socket and connect:
void CBlockingSocket::Create(int nType /* = SOCK_STREAM */)
{
ASSERT(m_hSocket == NULL);
if ((m_hSocket = socket(AF_INET, nType, 0)) == INVALID_SOCKET)
{
TRACE("n Socket Error !1 (%d)n", WSAGetLastError());
int err = WSAGetLastError();
}
}
BOOL CBlockingSocket::Connect(LPCSOCKADDR psa)
{
ASSERT(m_hSocket != NULL);
// should timeout by itself
if (connect(m_hSocket, psa, sizeof(SOCKADDR)) == SOCKET_ERROR)
{
int nLastErr = WSAGetLastError();
return FALSE;
}
return TRUE;
}
The real funny thing is that when I use the exact same code, class structure etc. in a VS2008 project, everything works as expected, but when I use it in a VS2010 project, at connect() I get a 10051 error, Network is unreachable.
EDIT: The original VS2010 proj. is compiled using UNICODE. I’ve made a new VS2010 using MULTI-BYTE for testing and the connect() method returns no error, and … connects. Could it be something wrong with my way of passing the address string to the constructor?
USES_CONVERSION;
LPTSTR addr = A2W("192.168.1.209");
m_pSMACLPRCli = new CSMACLPRCli(addr, 12010, m_hWnd);
m_pSMACLPRCli->StartThread();
SOLVED:
The real problem was not the connect() method, but had to do with my way of passing the address string to a constructor of a sockaddr object.
The constructor:
CSockAddr(const char *pchIP, const USHORT ushPort = 0) // dotted IP addr string
{
sin_family = AF_INET;
sin_port = htons(ushPort);
sin_addr.s_addr = inet_addr(pchIP);
}
Constructor call used by me:
CString m_strSrvIPAddr;
CSockAddr saServer((char *) LPTSTR(LPCTSTR(m_strSrvIPAddr)), USHORT(m_nPort));
I changed the call to this:
CStringA strAddr(m_strSrvIPAddr);
CSockAddr saServer((const char *) strAddr, USHORT(m_nPort));
So I had to do a conversion of the string from UNICODE to MULTI_BYTE.
|
spydark91 86 / 86 / 13 Регистрация: 03.03.2011 Сообщений: 1,873 |
||||
|
1 |
||||
|
02.06.2011, 16:38. Показов 6841. Ответов 24 Метки нет (Все метки)
написал самый простенький код для отправки письма
дает ошибку через секунд 10 (скрин) Миниатюры
__________________
0 |
|
86 / 86 / 13 Регистрация: 03.03.2011 Сообщений: 1,873 |
|
|
02.06.2011, 17:11 [ТС] |
2 |
|
хоть он и дает ошибку что интернета нет,но он ест,как я тогда на форуме сижу)
0 |
|
86 / 86 / 13 Регистрация: 03.03.2011 Сообщений: 1,873 |
|
|
03.06.2011, 19:06 [ТС] |
3 |
|
никто не знает..
0 |
|
igoriy 873 / 544 / 117 Регистрация: 24.11.2009 Сообщений: 1,329 |
||||
|
03.06.2011, 19:23 |
4 |
|||
|
вот мой код который я только что проверил — попробуй у себя
0 |
|
spydark91 86 / 86 / 13 Регистрация: 03.03.2011 Сообщений: 1,873 |
||||
|
03.06.2011, 20:11 [ТС] |
5 |
|||
|
та же самая ошибка(( Добавлено через 39 секунд
0 |
|
873 / 544 / 117 Регистрация: 24.11.2009 Сообщений: 1,329 |
|
|
03.06.2011, 20:12 |
6 |
|
Тогда не знаю.Проверил еще раз — работает
0 |
|
86 / 86 / 13 Регистрация: 03.03.2011 Сообщений: 1,873 |
|
|
03.06.2011, 20:12 [ТС] |
7 |
|
может это изза роутера?хотя он тут вроде непричем..
0 |
|
873 / 544 / 117 Регистрация: 24.11.2009 Сообщений: 1,329 |
|
|
03.06.2011, 20:13 |
8 |
|
да нее
0 |
|
86 / 86 / 13 Регистрация: 03.03.2011 Сообщений: 1,873 |
|
|
03.06.2011, 20:16 [ТС] |
9 |
|
скинь свой exe шник Добавлено через 41 секунду
0 |
|
873 / 544 / 117 Регистрация: 24.11.2009 Сообщений: 1,329 |
|
|
03.06.2011, 20:17 |
10 |
|
давай я исходник пришлю — ехешником ты будешь отправлять сообщения с моего ящика на другой мой ящик
0 |
|
spydark91 86 / 86 / 13 Регистрация: 03.03.2011 Сообщений: 1,873 |
||||
|
03.06.2011, 20:24 [ТС] |
11 |
|||
|
а,ну давай) Добавлено через 2 минуты
Добавлено через 2 минуты Добавлено через 17 секунд
0 |
|
igoriy 873 / 544 / 117 Регистрация: 24.11.2009 Сообщений: 1,329 |
||||
|
03.06.2011, 20:27 |
12 |
|||
|
вот
0 |
|
873 / 544 / 117 Регистрация: 24.11.2009 Сообщений: 1,329 |
|
|
03.06.2011, 20:29 |
13 |
|
вот исходник
0 |
|
86 / 86 / 13 Регистрация: 03.03.2011 Сообщений: 1,873 |
|
|
03.06.2011, 20:42 [ТС] |
14 |
|
на найден [Fatal Error] Unit1.pas(8): File not found: ‘IdExplicitTLSClientServerBase.dcu’
0 |
|
873 / 544 / 117 Регистрация: 24.11.2009 Сообщений: 1,329 |
|
|
03.06.2011, 20:43 |
15 |
|
а у тебя какая дельфя?
0 |
|
86 / 86 / 13 Регистрация: 03.03.2011 Сообщений: 1,873 |
|
|
03.06.2011, 20:44 [ТС] |
16 |
|
делфи 7
0 |
|
873 / 544 / 117 Регистрация: 24.11.2009 Сообщений: 1,329 |
|
|
03.06.2011, 20:45 |
17 |
|
а у меня 2010 — может в этом и причина
0 |
|
86 / 86 / 13 Регистрация: 03.03.2011 Сообщений: 1,873 |
|
|
03.06.2011, 20:59 [ТС] |
18 |
|
я писал свой код по видео уроку,так что мой должен работать Добавлено через 12 минут
0 |
|
873 / 544 / 117 Регистрация: 24.11.2009 Сообщений: 1,329 |
|
|
03.06.2011, 21:04 |
19 |
|
я в этом не силен
0 |
|
86 / 86 / 13 Регистрация: 03.03.2011 Сообщений: 1,873 |
|
|
03.06.2011, 22:03 [ТС] |
20 |
|
что ззначит такая ошибка —syntactically invalid EHLO argument(синтаксически недействительный аргумент EHLO) Добавлено через 15 минут
0 |
I am running an OpenVPN 2.4.9 server (without Access web interface) on a CentOS 7 machine for ~30 employees using Windows 10 laptops.
Recently, I noticed some people were disconnecting with UDP error 10051 after a few minutes of being connected. This error only occurs once in a while and always at the same clients and disappears after rebooting the operating system or after waiting an undefined amount of time.
According to Microsoft’s documentation this error is indicating that it cannot reach the network.
The clients can still use other networking functions (i.e. browsing the web) so general internet connectivity is available and the windows firewall is not configured to block the port I am using (otherwise the connection couldn’t have been established in the first place,right?). There are no firewalls or other middleboxes other than the windows firewall between the server and it’s clients.
Is there any advice that can be given to solve this riddle?
Server config:
user nobody
group nobody
persist-key
persist-tun
port 1094
proto udp
proto udp6
dev tun
ca easy-rsa/pki/ca.crt
cert c.crt
key c.key
dh dh.pem
cipher AES-256-CBC
auth SHA512
comp-lzo
reneg-sec 0
inactive 0
keepalive 10 36000
Client config:
client
dev tun
remote vpn.domain.tld 1094
comp-lzo
ca a/ca.crt
cert a/d.crt # EasyRSA generated
key a/d.key
auth-nocache
auth-user-pass
cipher AES-256-CBC
auth SHA512
remote-cert-tls server
reneg-sec 36000
When I tried to connect to an FTP server using filezilla it was showing an error.
*connection attempt failed with "10051".
Could not connect to server.*
What error is this and how can I solve this problem?
A. Prasad
8013 gold badges14 silver badges30 bronze badges
asked Jul 9, 2014 at 8:27
See What Are the Common Causes of Socket Error 10051?
A socket error, such as socket error 10051, occurs whenever one computer attempts to connect to another network or server. Error 10051 happens because the other network is unreachable, usually because there is a problem with the router or modem on the computer attempting the connection.
answered Jul 9, 2014 at 8:31
SPRBRNSPRBRN
7,08213 gold badges59 silver badges90 bronze badges
3
Socket error is kind of a common error we often face while using the internet for connecting to another computer, sending mails or just browsing. There are several errors having identical codes.
Sometimes the problem occurs because of our firewall and antivirus settings; sometimes the server or the computer we are trying to connect to reports an error. Basically there are lots of errors like this. Here we are giving some errors and their solutions.
Socket Error 10053
This error message reports “Software caused connection abort”.
Cause
There are several things that cause this error to happen.
- The established connection may be aborted by software. This can be possibly done by an antivirus program.
- Not only the software, it can also happen by network problem or server problem.
- If the port is inactive for a long time, the problem may arise.
- The MTU (Maximum Transmission Unit) settings can also create the problem.
Solutions
As the problems are widespread, the solutions are also quite dependent on the type of problem.
- If the problem is caused by the VPOP3 client while downloading or sending mail, then the antivirus program can cause the problem. Generally McAfee VirusScan 8 and Norton Antivirus 2004 is the reason behind the error. Also other antivirus programs can create the problem.
- If a VPOP3 client has stopped working due to some other reason,we have to wait till it gets fixed.
- In the case of MTU settings problems, the large value of MTU can be a cause to discard the message in the network. So we have to set the MTU value at 1432 and the MSS (Maximum Segment Size) must be set to 0 or to auto adjust.
Socket Error 10061

This error report says “Connection refused”.
Cause
There are quite a few reasons for this problem.
- The target computer may have refused the connection. This happens when the computer is not connected to any running server application.
- Sometimes the destination mail server is refusing to receive mail. The spam filter is preventing the mail from being received. This means the SMTP server is sending junk mails.
- The firewall can also block the new connection attempt. The Port 25 (needed for SMTP) and the Port 110 (needed for POP) are blocked by the firewall.
- The ISP can also be too busy to accept any new connection.
Solutions
There are couple of solutions for this error.
- If the error is reported during sending an email then the SMTP has an error. Maybe we have sent too much mail during a short period to the destination mail. So the destination mail server reported the sending mail server as spam. In this context, we can reduce the frequency of sending mail to the mail server. Also we can send the mail via relay server. But the use of the relay server is not quite secure to use as it’s used by spammers.
- We can disable the firewall for some period and try to send mail to the destination mail server. If it succeeds then we can be sure that the firewall is creating the problem. So we can add exceptions for the connection in the firewall.
Socket Error 10049
This error report says “Cannot assign requested address”.
Cause
The main reason behind this error is that the address entered is invalid in the IP address. It happens to bind the address which is not valid in the local computer address. Timing issues in the DNS lookup can also create this error.
Solutions
The solutions for this problem are quite limited.
- Sometimes the reason behind this problem is the firewall. So if we put the host for our server in the firewall (it can be our system firewall or the antivirus firewall), it can solve the problem.
- Also if we forward the port in the internal IP of the new PC which we are trying to connect, it can resolve the problem.
- For the timing issue in the DNS lookup we have to follow some tiny steps. In the ‘Diagnostics’ tab in the VPOP3 we have to press ‘TCP/IP Tuning Option’ button and tick the ‘Use synchronous DNS’.
Socket Error 10051
The error report says “Network is unreachable”.
Cause
There are several reasons behind the problem.
- The internet connection may be down so the router can find a way to send the data to the destination.
- The router may be misconfigured so the router is not able to communicate with the target server.
- The firewall may be blocking port 25, which is used for the SMTP client connection to send mails.
- If we have two or more routers connected then windows may be misconfigured to communicate.
Solutions
The solutions for this problem are quite simple.
- The ISP sometimes blocks port 25 to control the spam through their servers. So we can call them to unblock port 25 and also we can use their own SMTP server.
- If the firewall is blocking port 25 then we can add an exception for the port in the settings of firewall.
Socket Error 11004

The error report says “Valid name, no data of requested type”. The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for.
Solutions
- As the error is associated with DNS so first of all check whether the address typed is correct or not.
- Try to connect with the IP address instead of Domain name. Ping the domain name in the command prompt to get the IP address of the domain name.
- We also have to be sure that the firewall or any antivirus program isn’t blocking the ports.
- A registry scan may help in this context. Any reliable registry scanner software can do the job.
Socket Error 10013
The error message says “Permission denied”.
Cause
An attempt was made to access a socket in a way forbidden by its access permissions. An example is using a broadcast address for sendto without broadcast permission being set using setsockopt (SO_BROADCAST).
Another possible reason for the WSAEACCES error is that when the bind function is called, another application, service, or kernel mode driver is bound to the same address with exclusive access. Such exclusive access is a new feature of Windows NT 4.0 with SP4 and later, and is implemented by using the SO_EXCLUSIVEADDRUSE option.
Solutions
- Check the firewall settings whether it is blocking the port 25 or not. If yes then disable the firewall for some time and check whether the same error persists or not. Then we have to change the firewall settings so that it doesn’t block port 25.
- A registry scan may help in this context. Any reliable registry scanner software can do the job.
Socket Error 10060

The error report says “Connection timed out”. It means that the connected host failed to respond or the connection failed after some period of time.
Solutions
- The error simply means that the SMTP server needs authentication. So if we are using Outlook Express then we should check the box ‘My server requires authentication’.
- The firewall may also be blocking the connection. Disabling the firewall may resolve the error.
- The SMTP server may also be blocked. So contacting ISP may resolve the problem.
