You should check out these troubleshooting tips if you get Socket error 1013.
Speed up your computer in minutes
#include #include #include # comment pragma (lib, "Ws2_32.lib")int main (int argc, char ** argv) IResult interval; VSADATA-VSA; Taken; structure sockaddr_in server; printf ("Winsock initializes ... n"); if (WSAStartup (MAKEWORD (2, 2), & wsa)! matches 0) printf ("Failed. Error code:% d", WSAGetLastError ()); get char (); Return 1; printf ("Initialized. n"); // create socket functional assumption that ((s = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) printf ("Unable to create socket:% d", WSAGetLastError ()); get char (); printf ("The socket has been created. n"); server.sin_addr.s_addr = inet_addr ("18.104.22.168"); server. = sin_family AF_INET; server.sin_port = htons (80); // Connect to a remote generic server iResult means connection (s, (struct sockaddr *) & server, sizeof (server)); if (iResult == SOCKET_ERROR) printf ("Failed to connect with error:% ld n", WSAGetLastError ()); iResult = close socket (s); as if (iResult == SOCKET_ERROR) printf ("closesocket function failed:% ld n", WSAGetLastError ()); WSACleup (); get char (); Return 1; printf ("Connected"); get char (); Returns 0;
Essentially, this is a complete C program that createsIt sets up a point of sale and connects to Google. Simple (I’m a tutorial: http://www.binarytides.com/winsock-socket-programming-tutorial I’m completely new to inference programming).
Winsock is initializing ...Initialized.Take the created one.Login function failed with error: 10013
After some research, I discovered that it was actually an access denied error.I tried to show some fixes like launching Visual Studio Express as administrator and running these commands in my navigation prompt:
netsh winsock reset int directorynetsh reset internet log address reset.log hit
It should be noted that I need to run the second command: netsh int ip reset reset.log hit I got the following error message:
Reset, error.Access is denied.There is no user to reset the settings.
I have temporarily disabled Kaspersky Internet Security, but there is no solution. I am new to programming for And-C connectors.
This article provides help if you want to fix an issue that may cause you to bindexcluded port when SO_REUSEADDR is probably set.
Applies to: Windows Server 2012 R2
Original KB Number: Das 3039044
For example, suppose someone excludes a port by frequently running the following command on a computer that is running Windows Server 2012 R2, Windows Server 2012, or Windows Server 2008 R2:
netsh int ipv4 use exclusiveportrange protocol = tcp startport = Integer numberofports = 1
You also assume that you will then bind the SO_REUSEADDR socket to a specific TCP port on the workstation. In this situation, if you use the SO_REUSEADDR socket to re-bind to a TCP port, the bind will fail and you will receive a “WSEAACCES (10013)” error.
Therefore, if you are using a specific application that causes both deadlocks on Windows Server 2012 R2, Windows Server 2012, or Windows 2008 Hosting Server R2, it may not work correctly.
This underlying issue is due to a crisis in the tcpip.sys driver. In particular, the reuse flag was overridden with the RESERVED flag when the tcpip.sys driver contains an excluded port.
To work around this issue, use one of the importantMethods:
- Use a port that is not exclusively in the standard dynamic range (49 152 to 65 535), but do not specify a port as it is excluded by the
- Use CreatePersistentTcpPortReservation and lookuppersistenttcpportreservation to assign a port reservation.
Microsoft has confirmed that this is a flaw in Microsoft products and may be listed in the “Applies to” section.
See the setsockopt function description for more information on the SO_REUSEADDR parameter.
- 2 more minutes to read
- By default, Windows Server R2 cannot use the
netshinfluence to exclude ports. However, after a human installs hotfix 2665809 , , the Operations Course supports this functionality.
- This issue does occur on Windows 2008 Server and Windows Server 2003.