Ошибка 10048 beammp

BeamMP

Loading

BeamMP

Loading

10048 indicates multiple copies of beamng/beammp launcher running. Easiest fix is to restart PC. Second way would be to open task manager and close all tasks related to beamng and beammp and try again.

Full
Answer

What should I do if my call to bind fails?

If your call to bind fails, the first thing to do is check the error code. The error is stored in errno on Linux, but on Windows you will need to call WSAGetLastError (). If the error returned by bind () is 98 (Linux) or 10048 (Windows), then it means the local port you are trying to bind to is already in use.

What does bind failed with error code 10048 mean?

When i run it the console diplays this message: Bind failed with error code : 10048 which means that the function bind returned a nonzero value, so an error occurred, the 10048 error.

Why do I get eaddrinuse and 10048 errors?

If bind () causes error 98 (EADDRINUSE) or 10048 (WSAEADDRINUSE), it means you are trying to bind to a local port that is already in use. This is usually caused by one of three reasons: Another program is already using that port. Your program is already running and you’ve attempted to start it a second time.

How do I get the error message from WSA bind?

The error is stored in errno on Linux, but on Windows you will need to call WSAGetLastError (). If the error returned by bind () is 98 (Linux) or 10048 (Windows), then it means the local port you are trying to bind to is already in use. By the way, you can also get the error message in text form. On Linux it is just a call to strerror ().

Cause 1 can be fixed by terminating the program using your port, or having your program use a different port. Cause 2 can be fixed by only running one instance of your program at a time. Cause 3 can be fixed by waiting a few minutes or using the SO_REUSEADDR socket option.

How do I fix Runtime error 10048 address in use?

Start Registry Editor. Type regedit in window search box….Use the regedit command to access the HKEY_LOCAL_MACHINESYSTEMCurrentControlSet ServicesTCPIPParameters registry subkey.Create a new REG_DWORD value named TcpTimedWaitDelay.Set the value to 60 (unit is second).Restart the server.

What is error 10048?

The Windows Socket Error 10048 occurs when an application is unable to open a TCP/IP socket for communications with another application or computer. Normally, this indicates that the TCP/IP protocol is unavailable, or the desired port number for the socket is already in-use.

What is bind error?

The explain_bind function is used to obtain an explanation of an error returned by the bind(2) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail.

Why does socket bind fail?

If you’re seeing a «TCP/UDP: Socket bind failed on local address» error message in the OpenVPN log, it means your VPN connection is configured to bind to a fixed local address and/or port number, and that this address/port number is unavailable.

What is the bind code?

In programming and software design, binding is an application programming interface (API) that provides glue code specifically made to allow a programming language to use a foreign library or operating system service (one that is not native to that language).

What does to bind mean?

Definition of bind 1a : to make secure by tying His hands were bound with rope. b : to confine, restrain, or restrict as if with bonds … she was not wholly bound in mind by her middle-class existence— Delmore Schwartz. c : to put under an obligation binds himself with an oath.

What is bind function used for?

The bind() function shall assign a local socket address address to a socket identified by descriptor socket that has no local socket address assigned. Sockets created with the socket() function are initially unnamed; they are identified only by their address family.

How do you fix a run-time error?

How to Fix a Runtime ErrorRestart the computer. … Update the program to its latest version. … Fully delete the program, and then reinstall it. … Install the latest Microsoft Visual C++ Redistributable package. … Use SFC scannow to repair corrupted Windows files. … Run System Restore to return your computer to a previous state.More items…•

What Causes Run-time error 1004?

When you use a VBA code to select a range that is not in the active worksheet, VBA will show you the run-time error 1004. Because, if you want to select a cell or range of cells for a particular worksheet needs to be active at that point. You cannot select a cell from the sheet1 if the sheet2 is active right now.

How do I get rid of runtime error 1004?

To fix Runtime Error 1004 in Excel you can take initiatives like uninstalling Microsoft Work, creating a new Excel template, or deleting The “GWXL97. XLA” File.

How do I fix a run-time error in Excel?

Troubleshooting StepsStart Microsoft Excel.On the Menu Bar select «File» > «[Excel] Options» > «Trust Center» > «Trust Center Settings…» > «Macro Settings»In the top section, select the radio button for «Disable all macros with notification»More items…

What causes SQL server error 10048 to occur?

Now let’s see what causes this error to occur. Port 1433 is a standard port number for SQL Server.

How we resolve SQL server error 10048?

Now let’s dig into the solution part of this error. Here are some of the solutions that our Support Engineers follow to fix this error.

Conclusion

In short, SQL server error 10048 occurs when the TCP port where SQL server must run is used by other processes. Today, we saw how our Support Engineers fix this error.

The Setup

Image

Maybe you are programming a server in C or C++. Your socket code might use asetup like this: If your call to bind fails, the first thing to do is check the error code. Theerror is stored in errno on Linux, but on Windows you will need to callWSAGetLastError(). If the error returned by bind()is 98 (Linux) or 10048 (Wind…

See more on handsonnetworkprogramming.com

Getting The Error Message

  • By the way, you can also get the error message in text form. On Linux it is just a call to strerror(). For error 98, that will returnsomething such as «Address already in use». Getting the error text on Windows is a bit trickier. There are instructions ongetting the Windows error text here.The error message on Windows may be similar to «Only one usage of each socketaddress (protocol/addre…

See more on handsonnetworkprogramming.com

What Causes «Address Already in Use Error»

  • Basically, only one program can listen on a given protocol/address/port tupleat any given time. If more than one program were permitted to listen, then theoperating system wouldn’t know which program to send incoming connections to. When I hear about this error from readers, there is usually one of three causes.

See more on handsonnetworkprogramming.com

Summary

  • If bind()causes error 98 (EADDRINUSE) or 10048 (WSAEADDRINUSE), it meansyou are trying to bind to a local port that is already in use. This is usuallycaused by one of three reasons: 1. Another program is already using that port. 2. Your program is already running and you’ve attempted to start it a second time. 3. Your program was running recently a…

See more on handsonnetworkprogramming.com

Popular Posts:

  • 1. 1998 jeep grand cherokee how to clear error codes
  • 2. why am i getting error from china eastern
  • 3. how to write a do while loop in c «error: expected identifier or ‘(‘»
  • 4. if recursion does not have a special terminating case, what error will occur?
  • 5. what does error code oxc4eb827 mean on my hp printer
  • 6. how to fix verdict iptv error
  • 7. how to find the error of a prediction in r
  • 8. which of the following crc generators guarantee the detection of a single bit error
  • 9. how to fix this error the following packages have unmet dependencies: debian 9
  • 10. why is there an error sending activision verification code
  • I started with the simple server tutorial on the msdn website in order to learn how to use sockets in client and server applications.

    Once I was done following thet tutorial, I started adapting the client and server code into multithreaded proggrams in order to make a tchat client and server. Everything was going very well until I ran into WSA error 10048. I tried using different ports for each socket but it still did not solve the error.

    Here is my server code :

    #undef UNICODE
    #define WIN32_LEAN_AND_MEAN
    #include <windows.h>
    #include <winsock2.h>
    #include <ws2tcpip.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <iostream>
    #include <thread>
    #include <vector>
    // Need to link with Ws2_32.lib
    #pragma comment (lib, "Ws2_32.lib")
    // #pragma comment (lib, "Mswsock.lib")
    //Global values
    //I put them as global values in order to get the server up and running.
    //I will try to pass them as params later on
    int iResult;
    struct addrinfo *result = NULL;
    struct addrinfo hints;
    int numClients = 0;
    SOCKET ClientSocket[5];
    std::thread** sendReceiveThread = new std::thread*[5];
    //Prototypes
    int listen(SOCKET ListenSocket);
    int accept(SOCKET ListenSocket);
    int sendReceive();
    int shutdownFunction(SOCKET ClientSocket);
    #define DEFAULT_BUFLEN 512
    #define DEFAULT_PORT1 "1016"
    #define DEFAULT_PORT2 "1017"
    #define DEFAULT_PORT3 "1018"
    #define DEFAULT_PORT4 "1019"
    #define DEFAULT_PORT5 "1020"
    int main()
    {
    std::cout << 1 << std::endl;
    WSADATA wsaData;
    SOCKET ListenSocket = INVALID_SOCKET;
    // Initialize Winsock
    std::cout << 2 << std::endl;
    iResult = WSAStartup(MAKEWORD(2, 2), &wsaData);
    if (iResult != 0) {
    std::cout << 3 << std::endl;
    printf("WSAStartup failed with error: %dn", iResult);
    return 1;
    }
    ZeroMemory(&hints, sizeof(hints));
    hints.ai_family = AF_INET;
    hints.ai_socktype = SOCK_STREAM;
    hints.ai_protocol = IPPROTO_TCP;
    hints.ai_flags = AI_PASSIVE;
    std::thread ListenThread{ [ListenSocket](){listen(ListenSocket); } };
    ListenThread.join();
    return 0;
    }
    int listen(SOCKET ListenSocket)
    {
    int numPort = 1;
    std::vector<std::thread*> thread_vec;
    while (true)
    {
    if (numPort == 1)
    {
    // Resolve the server address and port
    std::cout << 4 << std::endl;
    iResult = getaddrinfo(NULL, DEFAULT_PORT1, &hints, &result);
    numPort++;
    if (iResult != 0) {
    std::cout << 5 << std::endl;
    printf("getaddrinfo failed with error: %dn", iResult);
    WSACleanup();
    break;
    }
    }
    else if (numPort == 2)
    {
    // Resolve the server address and port
    std::cout << 4 << std::endl;
    iResult = getaddrinfo(NULL, DEFAULT_PORT2, &hints, &result);
    numPort++;
    if (iResult != 0) {
    std::cout << 5 << std::endl;
    printf("getaddrinfo failed with error: %dn", iResult);
    WSACleanup();
    break;
    }
    }
    else if (numPort == 3)
    {
    // Resolve the server address and port
    std::cout << 4 << std::endl;
    iResult = getaddrinfo(NULL, DEFAULT_PORT3, &hints, &result);
    numPort++;
    if (iResult != 0) {
    std::cout << 5 << std::endl;
    printf("getaddrinfo failed with error: %dn", iResult);
    WSACleanup();
    break;
    }
    }
    else if (numPort == 4)
    {
    // Resolve the server address and port
    std::cout << 4 << std::endl;
    iResult = getaddrinfo(NULL, DEFAULT_PORT4, &hints, &result);
    numPort++;
    if (iResult != 0) {
    std::cout << 5 << std::endl;
    printf("getaddrinfo failed with error: %dn", iResult);
    WSACleanup();
    break;
    }
    }
    else if (numPort == 5)
    {
    // Resolve the server address and port
    std::cout << 4 << std::endl;
    iResult = getaddrinfo(NULL, DEFAULT_PORT5, &hints, &result);
    numPort++;
    if (iResult != 0) {
    std::cout << 5 << std::endl;
    printf("getaddrinfo failed with error: %dn", iResult);
    WSACleanup();
    break;
    }
    }
    // Create a SOCKET for connecting to server
    std::cout << 6 << std::endl;
    ListenSocket = socket(result->ai_family, result->ai_socktype, result->ai_protocol);
    if (ListenSocket == INVALID_SOCKET) {
    std::cout << 7 << std::endl;
    printf("socket failed with error: %ldn", WSAGetLastError());
    freeaddrinfo(result);
    WSACleanup();
    break;
    }
    // Setup the TCP listening socket
    std::cout << 8 << std::endl;
    iResult = bind(ListenSocket, result->ai_addr, (int)result->ai_addrlen);
    if (iResult == SOCKET_ERROR) {
    std::cout << 9 << std::endl;
    printf("bind failed with error: %dn", WSAGetLastError());
    freeaddrinfo(result);
    closesocket(ListenSocket);
    WSACleanup();
    break;
    }
    freeaddrinfo(result);
    std::cout << 10 << std::endl;
    iResult = listen(ListenSocket, SOMAXCONN);
    if (iResult == SOCKET_ERROR) {
    std::cout << 11 << std::endl;
    printf("listen failed with error: %dn", WSAGetLastError());
    closesocket(ListenSocket);
    WSACleanup();
    break;
    }
    static std::thread AcceptThread{ [ListenSocket](){accept(ListenSocket); } };
    thread_vec.push_back(&AcceptThread);
    }
    for (auto it : thread_vec) it->join();
    return 0;
    }
    int accept(SOCKET ListenSocket)
    {
    numClients++;
    const int currentNumClients = numClients;
    for (int i = 0; i <= 5; i++)
    {
    ClientSocket[i] = INVALID_SOCKET;
    }
    // Accept a client socket
    std::cout << 12 << std::endl;
    std::cout << 13 << std::endl;
    ClientSocket[currentNumClients] = accept(ListenSocket, NULL, NULL);
    if (ClientSocket[currentNumClients] == INVALID_SOCKET)
    {
    printf("accept failed with error: %dn", WSAGetLastError());
    closesocket(ListenSocket);
    WSACleanup();
    return 1;
    }
    sendReceiveThread[currentNumClients] = new std::thread([](){sendReceive(); });
    (*sendReceiveThread[currentNumClients]).join();
    delete sendReceiveThread[currentNumClients];
    return 0;
    }
    int sendReceive()
    {
    int currentNumClients = numClients;
    int iSendResult;
    char recvbuf[DEFAULT_BUFLEN];
    int recvbuflen = DEFAULT_BUFLEN;
    // Receive until the peer shuts down the connection
    while(true)
    {
    std::cout << 14 << std::endl;
    iResult = recv(ClientSocket[currentNumClients], recvbuf, recvbuflen, 0);
    std::cout << iResult << std::endl;
    if (iResult > 0) {
    std::cout << 15 << std::endl;
    printf("Bytes received: %dn", iResult);
    // Echo the buffer back to the clients
    std::cout << 16 << std::endl;
    for (int i = 1; i <= numClients; i++)
    {
    iSendResult = send(ClientSocket[currentNumClients], recvbuf, iResult, 0);
    if (iSendResult == SOCKET_ERROR) {
    std::cout << 17 << std::endl;
    printf("send failed with error: %dn", WSAGetLastError());
    closesocket(ClientSocket[currentNumClients]);
    WSACleanup();
    return 1;
    }
    printf("Bytes sent: %dn", iSendResult);
    }
    }
    else if (iResult == 0) {
    std::cout << 18 << std::endl;
    printf("Connection closing...n");
    break;
    }
    else {
    std::cout << 19 << std::endl;
    printf("recv failed with error: %dn", WSAGetLastError());
    std::cout << "On client #" << currentNumClients << std::endl;
    break;
    }
    }
    iResult = shutdownFunction(ClientSocket[currentNumClients]);
    std::cout << 22 << std::endl;
    // cleanup
    closesocket(ClientSocket[currentNumClients]);
    WSACleanup();
    return 0;
    }
    int shutdownFunction(SOCKET ClientSocket)
    {
    std::cout << 20 << std::endl;
    iResult = shutdown(ClientSocket, SD_SEND);
    if (iResult == SOCKET_ERROR) {
    std::cout << 21 << std::endl;
    printf("shutdown failed with error: %dn", WSAGetLastError());
    closesocket(ClientSocket);
    WSACleanup();
    return 1;
    }
    return 0;
    }
    

    You might notice the different couts, those are just couts to know how the proggram behaves.

    думаю, что у вас просто закончились динамические порты в системе…..

    ошибка (учитывая что изменение max_connection не помогает) формируется вовсе не из за mysql , а из-за невозможности винды предоставить нужное число портов.

    WSAEADDRINUSE
    (10048)
    Address already in use.
    Only one usage of each socket address (protocol/IP address/port) is normally permitted. This error occurs if an application attempts to bind a socket to an IP address/port that has already been used for an existing socket, or a socket that wasn’t closed properly, or one that is still in the process of closing. For server applications that need to bind multiple sockets to the same port number, consider using setsockopt(SO_REUSEADDR). Client applications usually need not call bind at all — connectwill choose an unused port automatically.»

    что в общем случае означает —

    Address already in use (Адрес уже используется).
    Обычно разрешено только одно использование адреса сокета (проткол/адрес IP/порт). Эта ошибка возникает, когда приложение пытается привязаться к сокету функцией bind(), но комбинация адрес IP/порт уже используется существующим сокетом, или сокет не был корректно закрыт, или продолжается процесс закрытия сокета. Для серверных приложений, требующих привязки нескольких сокетов к одному и тому же номеру порта следует использовать setsockopt(SO_REUSEADDR). Клиентские приложения обычно не используют bind() — функция connect() автоматически выбирает неиспользуемый порт.

    В вашем случае, при возрастании числа запросов к базе, когда открывается и закрывается куча подключений к базе, то оти попросту не успевают закрыться. Обратите внимание, что речь идет не о том, чтобы не забыть закрыть подключение mysql, а о том, что ресурсы для НОВОГО подключения освободятся не сразу….

    Если мне память не изменяет, то есть в реестре пара параметров, которые на это влияют.

    один из них — TcpTimedWaitDelay. Этот параметр определяет интервал времени, в течение которого подключение находится в состоянии ожидания, прежде чем будет закрыто. Пока подключение находится в состоянии ожидания, пара сокетов не может быть использована повторно. А согласно RFC793, данное значение должно в два раза превышать максимальное время жизни пакета.
    Если учесть что в Windows XP и Microsoft Windows Server 2003 значение по умолчанию было установлено на 120 секунд, то получается что целых 2 минуты система просто ждет никому не отдавая уже освободившийся ресурс.

    ищем тут

    Код: Выделить всё • Развернуть
    HKLMSYSTEMCurrentControLSetServicesTcpipParametersTcpTimedWaitDelay

    и уменьшаем значение.
    если нет, то создаем
    REG_DWORD – время в секундах , с допустимыми параметрами 30-300 (в десятичной системе)

    и второй параметр это MaxUserPort
    находится он в

    Код: Выделить всё • Развернуть
    HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters

    имеет тип DWORD и допустимые значения от десятичных 5000 (по умолчанию) до 65534

    он определяет максимальный номер порта, который используется, когда программа запрашивает у системы доступный пользовательский порт.

    в итоге изначально имеем в системе всего 5000-1024 = 3976 портов, доступных для приложений, да еще и повторно использовать их можно не чаще раза в 2 минуты…

    отпишитесь, плиз, помогло написанное или нет ?

    p.s. если параметра нет в реестре, то это не значит что он не используется, просто его значение принимается системой по умолчанию…..

    по итогам размышлений над

    http://bugs.mysql.com/bug.php?id=10498

    и

    http://bugs.mysql.com/bug.php?id=6580

    Лучше установить FreeBSD, чем потратить 20 лет на Linux’ы и выяснить какой из них хуже.

    фон:

    Недавно, когда я делал модель сети ввода -вывода, я столкнулся с проблемой. После того, как клиентское программное обеспечение подключено к серверу, не было возможности подключиться в течение длительного времени после периода времени. Позже было обнаружено, что розетка одного и того же порта клиента (Windows) не выпустил эту ручку через две минуты после закрытия, поэтому Bind-> Connect не удалось. Wsagetlasteror () возвращает 10048 ошибок.

    10048: Обычно каждый набор слов (протокол/сетевой адрес/порт) допускает только один раз.

    Проблема связана:

    Описание MSDN выглядит следующим образом:

    Эта ошибка часто возникает в функции связывания. Когда привязка, которая была привязкой, занята, в одном и том же порте возникает ошибка, но эта ошибка не влияет на выполнение привязки. Другими словами, второе выполнение Бинга во второй раз Ошибков нет, но при вызове Connect (). Код ошибки составляет 10048.

    Когда приложения привязывают привязанность при использовании привязки случайного порта, если порты между 1024 ~ 5000, зарезервированными операционной системой, заняты, BIND не ошибся, а Contect не удастся.

    При каких обстоятельствах порт будет занят?

    Ситуация 1: Если данные подвергаются данным по каждому порту, порт находится в состоянии занятия.

    Ситуация 2: Частота подключения слишком быстрая. После того, как Closocket используется для отключения операции, хотя CloseSocket выполняется, соответствующий порт занятий не сразу не высвобождается. Эти порты нуждаются в максимальном цикле выживания), максимальное значение По умолчанию 4 минуты. Используйте команду NetStat, чтобы просмотреть состояние порта, порт отображает time_wait, и если тот же порт подключен через 4 минуты, возникнут ошибки 10048.

    иллюстрировать:

    Когда новая версия клиента подключена к серверу при входе в систему, сокет имеет фиксированный порт привязки (старая версия не имеет фиксированного порта привязки. Сервер обсуждает его для определения этого).

    В соответствии с Windows система будет поддерживать 2 TTL (около 120S) для каждого соединения (включая закрытое соединение), а выпуск ресурса будет выпущен для следующего использования.

    Может быть, вы спросите, почему это не ошибка 10048 каждый раз? Причина в том, что время, когда вы входите в систему для непрерывного входа, превысили 120 -е годы. Вторая причина в том, что виртуальные машины сначала закрывают предыдущую ссылку, когда клиентские виртуальные машины.

    Ранее не было ошибок 10048, поскольку предыдущий клиент -сокет не связывал фиксированный порт, но был случайным образом назначен Windos, поэтому вероятность ошибок 10048 была значительно уменьшена. Тем не менее, Windows ограничивает общее количество локальных портов составляет 5000. Мы можем обнаружить, что если непрерывный подключение непрерывно, если Windows будет использовать 5000 портов, Connect также будет иметь 10048 ошибок.

    Решение:

    1. Случайно выделяли неиспользованные порты из Windos

    addr.sin_port = 0; // Если порт указан в 0, когда привязка вызвана, система будет указывать доступный номер порта для него

    2. Если используется функция связывания, вы можете указать порт привязки. Если подключение сбоя не сбои, то вернитесь к привязке, чтобы изменить порт привязки, а затем продолжить подключение до тех пор, пока он не преуспеет.

    3. Если функция связывания не используется и не подключается непосредственно с Connect, вы можете выполнить повторную попытку при операции подключения. В этом случае, если подключение сбой, то порт сбоя вызова будет подключен до тех пор, пока она не будет вызвана до тех пор, пока она не будет вызвана. Соединение подключено до успеха подключения.

    Случайным образом получить доступный номер порта:

    Идея: привязана к этой машине и используйте GetSockName для получения этого номера порта, связанного с гнездом

    Объявление функции:

    bool getAvaliablePort(unsigned short &port);
    // Возврат: если успешно это правда, иначе это ложь
    * @Brief Получите доступный порт
    *
    * @param port: output, возврат доступный номер порта
    *
    * @Return, если вы добьетесь успеха, верните True, иначе вы вернете ложь
    */
    bool getAvaliablePort(unsigned short &port)
    {
    bool result = true;
    // 1. Создать розетку
    SOCKET sock = socket(AF_INET, SOCK_STREAM, 0);
    // 2. Создайте Sockaddr и установите номер порта на 0
    struct sockaddr_in addr;
    addr.sin_family = AF_INET;
    addr.sin_addr.s_addr = htonl(ADDR_ANY);
    addr.sin_port = 0; // Если порт указан в 0, когда привязка вызвана, система будет указывать доступный номер порта для него
    // 3. Переплет
    int ret = bind(sock, (SOCKADDR*)&addr, sizeof addr);
    if (0 != ret) {
    result = false;
    goto END;
    }
    // 4. Используйте GetSockName, чтобы получить
    struct sockaddr_in connAddr;
    int len = sizeof connAddr;
    ret = getsockname(sock, (SOCKADDR*)&connAddr, &len);
    if (0 != ret){
    result = false;
    goto END;
    }
    port = ntohs (connaddr.sin_port); // Получить номер порта
    END:
    if ( 0 != closesocket(sock) )
    result = false;
    return result;
    }

    Ссылаться на:https://www.cnblogs.com/hdtianfu/archive/2012/10/20/2732675.html

               https://blog.csdn.net/qq_17242957/article/details/43053961

               https://bbs.csdn.net/topics/390292355

    Содержание

    1. Bind fails with error 98 (or error 10048)
    2. The Setup
    3. Getting the Error Message
    4. What causes «Address already in use error»
    5. 1. Another program is using that port
    6. 2. Your program is already running
    7. 3. TCP Linger / TIME-WAIT
    8. Summary
    9. ¶ Launcher Error Codes
    10. ¶ Other Error Codes (Server and Launcher)
    11. server: bind failed with error: 10048 #2
    12. Comments
    13. Bind failed with error 10048 beam mp

    Bind fails with error 98 (or error 10048)

    A common socket programming error I hear about is error 98 (EADDRINUSE) or 10048 (WSAEADDRINUSE) from bind() .

    The Setup

    Maybe you are programming a server in C or C++. Your socket code might use a setup like this:

    If your call to bind fails, the first thing to do is check the error code. The error is stored in errno on Linux, but on Windows you will need to call WSAGetLastError() .

    If the error returned by bind() is 98 (Linux) or 10048 (Windows), then it means the local port you are trying to bind to is already in use.

    Getting the Error Message

    By the way, you can also get the error message in text form.

    On Linux it is just a call to strerror() . For error 98, that will return something such as «Address already in use».

    Getting the error text on Windows is a bit trickier. There are instructions on getting the Windows error text here. The error message on Windows may be similar to «Only one usage of each socket address (protocol/address/port) is normally permitted.»

    In any case, now that you know the what the error is, how do you fix it?

    What causes «Address already in use error»

    Basically, only one program can listen on a given protocol/address/port tuple at any given time. If more than one program were permitted to listen, then the operating system wouldn’t know which program to send incoming connections to.

    When I hear about this error from readers, there is usually one of three causes.

    1. Another program is using that port

    The most obvious cause for the error is that another program is using the port you want to listen on. In this case, you can change the port your program listens on, or you can close the other program that is using that port.

    On Linux, you can see which other programs are listening for connections using the netstat -ntlp command. The ntlp stands for «numeric tcp listen programs». In order words, we are asking netstat to show port numbers (numeric), to only show TCP sockets, to only show sockets in the listening state, and to show which programs are using the sockets.

    The following screenshot shows using the netstat command on Linux to find which program is tying up port 8080.

    As you can see above, the program tying up port 8080 is «server1» with a PID of 96939. Knowing the PID, you can easily kill the program if you like. Just please be sure you know what the program is and whether you really need it or not before you go around terminating things willy-nilly.

    Windows also has a netstat command, but the usage is different. On Windows you can show all listening sockets with the command netstat -nao -p TCP | findstr LISTEN . Window’s netstat command doesn’t have an easy way to filter only listening sockets, so the findstr program comes in handy. In any case, running that command will list each listening TCP socket and show the owner program’s PID for each socket.

    The following screenshot shows the usage of netstat on Windows to see which program is using port 8080:

    As shown in the above screenshot, netstat lists each program’s listening address and PID. You can get more info on a PID with the tasklist command. For example, running tasklist | findstr 50396 would get us the program name for PID 50396 — the process we identified as using port 8080. For example:

    The above screenshot shows that the program «server1.exe» has the PID of 50396, and therefore is the program using port 8080.

    2. Your program is already running

    This is more common than you think. Is your program already running? If it is, then of course the port is already in use!

    This also isn’t always as easy to determine as you might like. In the server world, it’s very common for programs to run in the background or as daemons. In any case, if you get a bind() error or address already in use error, be sure to check that your program isn’t already running.

    3. TCP Linger / TIME-WAIT

    I’ve saved the most complicated scenario for last. Suppose your server program is running, and then you terminate it (or it crashes). When you restart it, you get the address in use error (EADDRINUSE or WSAEADDRINUSE). However, if you wait a couple minutes, you are able to start your program without error. What is going on here?

    I won’t go into too much depth here (read my book for that), but basically when a socket is closed it can go into a TIME-WAIT state on the end that initiated the close. This isn’t a problem for a client program, since it doesn’t use bind() anyway (typically). However, this TIME-WAIT state can be a problem for server applications. It means the operating system is still keeping track of the closed socket, even after your entire program is closed. This is enough to cause the «Address already in use» error if you restart your program.

    Now, there is an easy way to prevent this error on Linux. You can use the SO_REUSEADDR socket option before calling bind() . It looks like this:

    This option will allow bind() to succeed even if a few TIME-WAIT connections are still around. There is very little downside to using the SO_REUSEADDR on Linux, so I suggest most server applications use it in that environment.

    There is a major drawback to using this option on Windows. When using SO_REUSEADDR on Windows, the OS will simply allow multiple programs to bind to the same port. When an incoming connection is routed, it will only go to one program. This doesn’t mean you shouldn’t use SO_REUSEADDR on Windows, but you should certainly be aware of this behavior.

    In any case, check out Chapter 13 of my book for more information.

    Summary

    If bind() causes error 98 (EADDRINUSE) or 10048 (WSAEADDRINUSE), it means you are trying to bind to a local port that is already in use. This is usually caused by one of three reasons:

    1. Another program is already using that port.
    2. Your program is already running and you’ve attempted to start it a second time.
    3. Your program was running recently and some connections are still lingering around in the half-dead TIME-WAIT state.

    Cause 1 can be fixed by terminating the program using your port, or having your program use a different port.

    Cause 2 can be fixed by only running one instance of your program at a time.

    Cause 3 can be fixed by waiting a few minutes or by using the SO_REUSEADDR socket option on Linux. The SO_REUSEADDR option has the drawback on Windows that it will allow multiple programs to listen on the same port, but only one will actually receive connections.

    I hope you found this article helpful. I’d love to hear any feedback you might have. Don’t hesitate to get in touch.

    If you found this information helpful, you might be interested in my book.

    Источник

    ¶ Launcher Error Codes

    Below is a list of all the Launcher Error Codes, what they mean & how to solve them in most cases.
    If the launcher starts but encounters random errors they should be reported

    Note: If the launcher closes immediately check the log you will find startup error codes

    If the launcher gets stuck updating that means it requires administrator privileges or you need to update manually, sometimes the antivirus may block downloads as well

    Logger file init failed

    • The launcher doesn’t have the ability to create files, Launching as admin could fix the issue

    Sorry Backend System Outage! Don’t worry it will back on soon!

    • The Backend did not respond could be the firewall or ISP

    Primary Servers Offline! sorry for the inconvenience!

    • The Launcher failed to check for an update firewall or ISP

    Launcher Update failed!

    • The launcher failed to download the new version

    Please close the game and try again

    • This error will happen if the game is already running under the same profile / launcher was unable clear the multiplayer/mods folder

    Please launch the game at least once

    • This will happen when the launcher tries to modify the game’s profile directory and fails. Launching the game should fix it

    Failed to Launch the game! launcher closing soon

    • Launcher failed to start the game launching the game once before retrying could fix it

    Game Closed! launcher closing soon

    • This will happen after the launcher was able to start the game and shouldn’t happen unless the game failed to start or closed

    Failed to find the game please launch it. Report this if the issue persists

    • Code 3 means that the launcher was unable to find the game’s info (game directory, profile directory, version ect. ) in the registry entry. Potential fix is to just run the game at least once so the registry values get created
    • Code 4 means the same except the launcher was unable to read the registry values

    ¶ Other Error Codes (Server and Launcher)

    Below is a list of all the Server Error Codes, what they mean & how to solve them in most cases.

    Note: If the server closes immediately check the log you will find startup error codes

    • There is an issue with your ports. Please check you have port forwarded and opened it on incoming on your firewall
    • This is an issue with binding to the port. Check if the port is in use or use a different port
    • address already in use, another BeamMP server or program is already running on that port
    • bad port forwarding or other similar «unreachable» issue — verify that its all setup properly
    • network reset, happens if the network drops connection while a connection is being established. should never happen. just retry
    • connection aborted, timeout or other network error, just retry
    • on launcher: server closed
    • on server: client disconnected

    Code 10060 / 10061

    • network timed out, on launcher, this usually means that the server wasnt port forwarded properly
    • unlikely error, but it means that the host died, so server shutdown or ports were closed, connection died some other way
    • host not reachable: no internet or bad port forwarding, or any other similar issue*

    Источник

    I get the error server: bind failed with error: 10048 (port for remote management is busy, use different -mport value), next attempt in 20sec.

    I am using windows and configured it as you said.

    The text was updated successfully, but these errors were encountered:

    Did you get the error on the no-fee-proxy window ?
    It seems the port is already taken by the remote management engine.
    Can you change the proxy port ? or change the claymore’s remote port (with -mport argument)

    Yes, the error was in the proxy window. I can try and change one, and then the other and let you know.

    This is just an issue on one of my rigs. The other rigs get different issues.

    There are some weird connection issues with my other boxes as well. Most of the time they revert to the epools.txt. I can tell because I set a different name in the epools.txt so I can see in the pool display if they failed over.

    They everyone one of my boxes fails over at least once an hour.

    Are you using ethos by chance?

    No, this is all on Windows.

    I would be glad to help trouble shoot all of the issues I am experiencing. This is such a great project and I would like to help work the kinks out.

    What can I do to assist?

    I added you as a contributor, feel free to make changes as you see fit. I have some time to debug this tomorrow, also feel free to dm me in a gitter or something.

    Источник

    Bind failed with error 10048 beam mp

    Сообщения: 1545
    Благодарности: 48

    Petya V4sechkin, в общем проблема оказалась в безобидном VNC-сервере. Он работает как служба.

    Не понимаю, чем мог помешать VNC-сервер? Он занимает конкретные порты 5800 и 5900. И все.

    А причем тут вышеуказанный порт 10048 тогда?

    Каждый раз тушить VCN как-то нехорошо.

    Сообщения: 52604
    Благодарности: 15253

    Конфигурация компьютера
    Материнская плата: ASUS P8Z77-V LE PLUS
    HDD: Samsung SSD 850 PRO 256 Гб, WD Green WD20EZRX 2 Тб
    Звук: Realtek ALC889 HD Audio
    CD/DVD: ASUS DRW-24B5ST
    ОС: Windows 10 Pro x64

    А причем тут вышеуказанный порт 10048 тогда?

    Это не порт, а код ошибки Winsock.

    Он занимает конкретные порты 5800 и 5900

    Это сообщение посчитали полезным следующие участники:

    Порты можно изменить в настройках. »

    Изменил в на сервере VNC порт 5800 на 5801 — теперь проблемная программа работает.
    Но что интересно, то запущенный процесс от этой программы (TransData.exe) не занимает ни один порт, о чем свидетельствует netstat -aon. Также юзал tcpview — там процесс TransData.exe не отображается.

    Т.е. может быть такое, что при запуске программа смотрит наличия доступа на порт 5800 и если его нет, то не стартует. Иначе же запускается, но порт не занимает.

    ?

    Сообщения: 52604
    Благодарности: 15253

    Конфигурация компьютера
    Материнская плата: ASUS P8Z77-V LE PLUS
    HDD: Samsung SSD 850 PRO 256 Гб, WD Green WD20EZRX 2 Тб
    Звук: Realtek ALC889 HD Audio
    CD/DVD: ASUS DRW-24B5ST
    ОС: Windows 10 Pro x64

    не занимает ни один порт, о чем свидетельствует netstat -aon. Также юзал tcpview

    Это сообщение посчитали полезным следующие участники:

    Adblock
    detector

    Bind fails with error 98 (or error 10048)

    A common socket programming error I hear about is error 98 (EADDRINUSE) or 10048 (WSAEADDRINUSE) from bind() .

    The Setup

    Maybe you are programming a server in C or C++. Your socket code might use a setup like this:

    If your call to bind fails, the first thing to do is check the error code. The error is stored in errno on Linux, but on Windows you will need to call WSAGetLastError() .

    If the error returned by bind() is 98 (Linux) or 10048 (Windows), then it means the local port you are trying to bind to is already in use.

    Getting the Error Message

    By the way, you can also get the error message in text form.

    On Linux it is just a call to strerror() . For error 98, that will return something such as «Address already in use».

    Getting the error text on Windows is a bit trickier. There are instructions on getting the Windows error text here. The error message on Windows may be similar to «Only one usage of each socket address (protocol/address/port) is normally permitted.»

    In any case, now that you know the what the error is, how do you fix it?

    What causes «Address already in use error»

    Basically, only one program can listen on a given protocol/address/port tuple at any given time. If more than one program were permitted to listen, then the operating system wouldn’t know which program to send incoming connections to.

    When I hear about this error from readers, there is usually one of three causes.

    1. Another program is using that port

    The most obvious cause for the error is that another program is using the port you want to listen on. In this case, you can change the port your program listens on, or you can close the other program that is using that port.

    On Linux, you can see which other programs are listening for connections using the netstat -ntlp command. The ntlp stands for «numeric tcp listen programs». In order words, we are asking netstat to show port numbers (numeric), to only show TCP sockets, to only show sockets in the listening state, and to show which programs are using the sockets.

    The following screenshot shows using the netstat command on Linux to find which program is tying up port 8080.

    As you can see above, the program tying up port 8080 is «server1» with a PID of 96939. Knowing the PID, you can easily kill the program if you like. Just please be sure you know what the program is and whether you really need it or not before you go around terminating things willy-nilly.

    Windows also has a netstat command, but the usage is different. On Windows you can show all listening sockets with the command netstat -nao -p TCP | findstr LISTEN . Window’s netstat command doesn’t have an easy way to filter only listening sockets, so the findstr program comes in handy. In any case, running that command will list each listening TCP socket and show the owner program’s PID for each socket.

    The following screenshot shows the usage of netstat on Windows to see which program is using port 8080:

    As shown in the above screenshot, netstat lists each program’s listening address and PID. You can get more info on a PID with the tasklist command. For example, running tasklist | findstr 50396 would get us the program name for PID 50396 — the process we identified as using port 8080. For example:

    The above screenshot shows that the program «server1.exe» has the PID of 50396, and therefore is the program using port 8080.

    2. Your program is already running

    This is more common than you think. Is your program already running? If it is, then of course the port is already in use!

    This also isn’t always as easy to determine as you might like. In the server world, it’s very common for programs to run in the background or as daemons. In any case, if you get a bind() error or address already in use error, be sure to check that your program isn’t already running.

    3. TCP Linger / TIME-WAIT

    I’ve saved the most complicated scenario for last. Suppose your server program is running, and then you terminate it (or it crashes). When you restart it, you get the address in use error (EADDRINUSE or WSAEADDRINUSE). However, if you wait a couple minutes, you are able to start your program without error. What is going on here?

    I won’t go into too much depth here (read my book for that), but basically when a socket is closed it can go into a TIME-WAIT state on the end that initiated the close. This isn’t a problem for a client program, since it doesn’t use bind() anyway (typically). However, this TIME-WAIT state can be a problem for server applications. It means the operating system is still keeping track of the closed socket, even after your entire program is closed. This is enough to cause the «Address already in use» error if you restart your program.

    Now, there is an easy way to prevent this error on Linux. You can use the SO_REUSEADDR socket option before calling bind() . It looks like this:

    This option will allow bind() to succeed even if a few TIME-WAIT connections are still around. There is very little downside to using the SO_REUSEADDR on Linux, so I suggest most server applications use it in that environment.

    There is a major drawback to using this option on Windows. When using SO_REUSEADDR on Windows, the OS will simply allow multiple programs to bind to the same port. When an incoming connection is routed, it will only go to one program. This doesn’t mean you shouldn’t use SO_REUSEADDR on Windows, but you should certainly be aware of this behavior.

    In any case, check out Chapter 13 of my book for more information.

    Summary

    If bind() causes error 98 (EADDRINUSE) or 10048 (WSAEADDRINUSE), it means you are trying to bind to a local port that is already in use. This is usually caused by one of three reasons:

    1. Another program is already using that port.
    2. Your program is already running and you’ve attempted to start it a second time.
    3. Your program was running recently and some connections are still lingering around in the half-dead TIME-WAIT state.

    Cause 1 can be fixed by terminating the program using your port, or having your program use a different port.

    Cause 2 can be fixed by only running one instance of your program at a time.

    Cause 3 can be fixed by waiting a few minutes or by using the SO_REUSEADDR socket option on Linux. The SO_REUSEADDR option has the drawback on Windows that it will allow multiple programs to listen on the same port, but only one will actually receive connections.

    I hope you found this article helpful. I’d love to hear any feedback you might have. Don’t hesitate to get in touch.

    If you found this information helpful, you might be interested in my book.

    Источник

    ¶ Launcher Error Codes

    Below is a list of all the Launcher Error Codes, what they mean & how to solve them in most cases.
    If the launcher starts but encounters random errors they should be reported

    Note: If the launcher closes immediately check the log you will find startup error codes

    If the launcher gets stuck updating that means it requires administrator privileges or you need to update manually, sometimes the antivirus may block downloads as well

    Logger file init failed

    • The launcher doesn’t have the ability to create files, Launching as admin could fix the issue

    Sorry Backend System Outage! Don’t worry it will back on soon!

    • The Backend did not respond could be the firewall or ISP

    Primary Servers Offline! sorry for the inconvenience!

    • The Launcher failed to check for an update firewall or ISP

    Launcher Update failed!

    • The launcher failed to download the new version

    Please close the game and try again

    • This error will happen if the game is already running under the same profile / launcher was unable clear the multiplayer/mods folder

    Please launch the game at least once

    • This will happen when the launcher tries to modify the game’s profile directory and fails. Launching the game should fix it

    Failed to Launch the game! launcher closing soon

    • Launcher failed to start the game launching the game once before retrying could fix it

    Game Closed! launcher closing soon

    • This will happen after the launcher was able to start the game and shouldn’t happen unless the game failed to start or closed

    Failed to find the game please launch it. Report this if the issue persists

    • Code 3 means that the launcher was unable to find the game’s info (game directory, profile directory, version ect. ) in the registry entry. Potential fix is to just run the game at least once so the registry values get created
    • Code 4 means the same except the launcher was unable to read the registry values

    ¶ Other Error Codes (Server and Launcher)

    Below is a list of all the Server Error Codes, what they mean & how to solve them in most cases.

    Note: If the server closes immediately check the log you will find startup error codes

    • There is an issue with your ports. Please check you have port forwarded and opened it on incoming on your firewall
    • This is an issue with binding to the port. Check if the port is in use or use a different port
    • address already in use, another BeamMP server or program is already running on that port
    • bad port forwarding or other similar «unreachable» issue — verify that its all setup properly
    • network reset, happens if the network drops connection while a connection is being established. should never happen. just retry
    • connection aborted, timeout or other network error, just retry
    • on launcher: server closed
    • on server: client disconnected

    Code 10060 / 10061

    • network timed out, on launcher, this usually means that the server wasnt port forwarded properly
    • unlikely error, but it means that the host died, so server shutdown or ports were closed, connection died some other way
    • host not reachable: no internet or bad port forwarding, or any other similar issue*

    Источник

    How to fix Bind Failed Error 10048 —> Error?

    Click here follow the steps to fix Bind Failed Error 10048 and related errors.

    To Fix (Bind Failed Error 10048) error you need to follow the steps below:

    Click ‘Fix All‘ and you’re done!

    Compatibility : Windows 7, 8, Vista, XP
    Download Size : 6MB
    Requirements : 300 MHz Processor, 256 MB Ram, 22 MB HDD

    Limitations: This download is a free evaluation version. To unlock all features and tools, a purchase is required.

    Bind Failed Error 10048 Error Codes are caused in one way or another by misconfigured system files in your windows operating system.

    If you have Bind Failed Error 10048 errors then we strongly recommend that you Download (Bind Failed Error 10048) Repair Tool .

    This article contains information that shows you how to fix Bind Failed Error 10048 both (manually) and (automatically) , In addition, this article will help you troubleshoot some common error messages related to Bind Failed Error 10048 error code that you may receive.

    Note: This article was updated on 2023-01-05 and previously published under WIKI_Q210794

    Contents

    What is Bind Failed Error 10048 error?

    The Bind Failed Error 10048 error is the Hexadecimal format of the error caused. This is common error code format used by windows and other windows compatible software and driver vendors.

    This code is used by the vendor to identify the error caused. This Bind Failed Error 10048 error code has a numeric error number and a technical description. In some cases the error may have more parameters in Bind Failed Error 10048 format .This additional hexadecimal code are the address of the memory locations where the instruction(s) was loaded at the time of the error.

    What causes Bind Failed Error 10048 error?

    The Bind Failed Error 10048 error may be caused by windows system files damage. The corrupted system files entries can be a real threat to the well being of your computer.

    There can be many events which may have resulted in the system files errors. An incomplete installation, an incomplete uninstall, improper deletion of applications or hardware. It can also be caused if your computer is recovered from a virus or adware/spyware attack or by an improper shutdown of the computer. All the above actives may result in the deletion or corruption of the entries in the windows system files. This corrupted system file will lead to the missing and wrongly linked information and files needed for the proper working of the application.

    How to easily fix Bind Failed Error 10048 error?

    There are two (2) ways to fix Bind Failed Error 10048 Error:

    Advanced Computer User Solution (manual update):

    1) Start your computer and log on as an administrator.

    2) Click the Start button then select All Programs, Accessories, System Tools, and then click System Restore.

    3) In the new window, select «Restore my computer to an earlier time» option and then click Next.

    4) Select the most recent system restore point from the «On this list, click a restore point» list, and then click Next.

    5) Click Next on the confirmation window.

    6) Restarts the computer when the restoration is finished.

    Novice Computer User Solution (completely automated):

    2) Install program and click Scan button.

    3) Click the Fix Errors button when scan is completed.

    4) Restart your computer.

    How does it work?

    This tool will scan and diagnose, then repairs, your PC with patent pending technology that fix your windows operating system registry structure.
    basic features: (repairs system freezing and rebooting issues , start-up customization , browser helper object management , program removal management , live updates , windows structure repair.)

    Источник

    Adblock
    detector

    Instructions

    I started with the simple server tutorial on the msdn website in order to learn how to use sockets in client and server applications.

    Once I was done following thet tutorial, I started adapting the client and server code into multithreaded proggrams in order to make a tchat client and server. Everything was going very well until I ran into WSA error 10048. I tried using different ports for each socket but it still did not solve the error.

    Here is my server code :

    #undef UNICODE
    #define WIN32_LEAN_AND_MEAN
    #include <windows.h>
    #include <winsock2.h>
    #include <ws2tcpip.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <iostream>
    #include <thread>
    #include <vector>
    // Need to link with Ws2_32.lib
    #pragma comment (lib, "Ws2_32.lib")
    // #pragma comment (lib, "Mswsock.lib")
    //Global values
    //I put them as global values in order to get the server up and running.
    //I will try to pass them as params later on
    int iResult;
    struct addrinfo *result = NULL;
    struct addrinfo hints;
    int numClients = 0;
    SOCKET ClientSocket[5];
    std::thread** sendReceiveThread = new std::thread*[5];
    //Prototypes
    int listen(SOCKET ListenSocket);
    int accept(SOCKET ListenSocket);
    int sendReceive();
    int shutdownFunction(SOCKET ClientSocket);
    #define DEFAULT_BUFLEN 512
    #define DEFAULT_PORT1 "1016"
    #define DEFAULT_PORT2 "1017"
    #define DEFAULT_PORT3 "1018"
    #define DEFAULT_PORT4 "1019"
    #define DEFAULT_PORT5 "1020"
    int main()
    {
    std::cout << 1 << std::endl;
    WSADATA wsaData;
    SOCKET ListenSocket = INVALID_SOCKET;
    // Initialize Winsock
    std::cout << 2 << std::endl;
    iResult = WSAStartup(MAKEWORD(2, 2), &wsaData);
    if (iResult != 0) {
    std::cout << 3 << std::endl;
    printf("WSAStartup failed with error: %dn", iResult);
    return 1;
    }
    ZeroMemory(&hints, sizeof(hints));
    hints.ai_family = AF_INET;
    hints.ai_socktype = SOCK_STREAM;
    hints.ai_protocol = IPPROTO_TCP;
    hints.ai_flags = AI_PASSIVE;
    std::thread ListenThread{ [ListenSocket](){listen(ListenSocket); } };
    ListenThread.join();
    return 0;
    }
    int listen(SOCKET ListenSocket)
    {
    int numPort = 1;
    std::vector<std::thread*> thread_vec;
    while (true)
    {
    if (numPort == 1)
    {
    // Resolve the server address and port
    std::cout << 4 << std::endl;
    iResult = getaddrinfo(NULL, DEFAULT_PORT1, &hints, &result);
    numPort++;
    if (iResult != 0) {
    std::cout << 5 << std::endl;
    printf("getaddrinfo failed with error: %dn", iResult);
    WSACleanup();
    break;
    }
    }
    else if (numPort == 2)
    {
    // Resolve the server address and port
    std::cout << 4 << std::endl;
    iResult = getaddrinfo(NULL, DEFAULT_PORT2, &hints, &result);
    numPort++;
    if (iResult != 0) {
    std::cout << 5 << std::endl;
    printf("getaddrinfo failed with error: %dn", iResult);
    WSACleanup();
    break;
    }
    }
    else if (numPort == 3)
    {
    // Resolve the server address and port
    std::cout << 4 << std::endl;
    iResult = getaddrinfo(NULL, DEFAULT_PORT3, &hints, &result);
    numPort++;
    if (iResult != 0) {
    std::cout << 5 << std::endl;
    printf("getaddrinfo failed with error: %dn", iResult);
    WSACleanup();
    break;
    }
    }
    else if (numPort == 4)
    {
    // Resolve the server address and port
    std::cout << 4 << std::endl;
    iResult = getaddrinfo(NULL, DEFAULT_PORT4, &hints, &result);
    numPort++;
    if (iResult != 0) {
    std::cout << 5 << std::endl;
    printf("getaddrinfo failed with error: %dn", iResult);
    WSACleanup();
    break;
    }
    }
    else if (numPort == 5)
    {
    // Resolve the server address and port
    std::cout << 4 << std::endl;
    iResult = getaddrinfo(NULL, DEFAULT_PORT5, &hints, &result);
    numPort++;
    if (iResult != 0) {
    std::cout << 5 << std::endl;
    printf("getaddrinfo failed with error: %dn", iResult);
    WSACleanup();
    break;
    }
    }
    // Create a SOCKET for connecting to server
    std::cout << 6 << std::endl;
    ListenSocket = socket(result->ai_family, result->ai_socktype, result->ai_protocol);
    if (ListenSocket == INVALID_SOCKET) {
    std::cout << 7 << std::endl;
    printf("socket failed with error: %ldn", WSAGetLastError());
    freeaddrinfo(result);
    WSACleanup();
    break;
    }
    // Setup the TCP listening socket
    std::cout << 8 << std::endl;
    iResult = bind(ListenSocket, result->ai_addr, (int)result->ai_addrlen);
    if (iResult == SOCKET_ERROR) {
    std::cout << 9 << std::endl;
    printf("bind failed with error: %dn", WSAGetLastError());
    freeaddrinfo(result);
    closesocket(ListenSocket);
    WSACleanup();
    break;
    }
    freeaddrinfo(result);
    std::cout << 10 << std::endl;
    iResult = listen(ListenSocket, SOMAXCONN);
    if (iResult == SOCKET_ERROR) {
    std::cout << 11 << std::endl;
    printf("listen failed with error: %dn", WSAGetLastError());
    closesocket(ListenSocket);
    WSACleanup();
    break;
    }
    static std::thread AcceptThread{ [ListenSocket](){accept(ListenSocket); } };
    thread_vec.push_back(&AcceptThread);
    }
    for (auto it : thread_vec) it->join();
    return 0;
    }
    int accept(SOCKET ListenSocket)
    {
    numClients++;
    const int currentNumClients = numClients;
    for (int i = 0; i <= 5; i++)
    {
    ClientSocket[i] = INVALID_SOCKET;
    }
    // Accept a client socket
    std::cout << 12 << std::endl;
    std::cout << 13 << std::endl;
    ClientSocket[currentNumClients] = accept(ListenSocket, NULL, NULL);
    if (ClientSocket[currentNumClients] == INVALID_SOCKET)
    {
    printf("accept failed with error: %dn", WSAGetLastError());
    closesocket(ListenSocket);
    WSACleanup();
    return 1;
    }
    sendReceiveThread[currentNumClients] = new std::thread([](){sendReceive(); });
    (*sendReceiveThread[currentNumClients]).join();
    delete sendReceiveThread[currentNumClients];
    return 0;
    }
    int sendReceive()
    {
    int currentNumClients = numClients;
    int iSendResult;
    char recvbuf[DEFAULT_BUFLEN];
    int recvbuflen = DEFAULT_BUFLEN;
    // Receive until the peer shuts down the connection
    while(true)
    {
    std::cout << 14 << std::endl;
    iResult = recv(ClientSocket[currentNumClients], recvbuf, recvbuflen, 0);
    std::cout << iResult << std::endl;
    if (iResult > 0) {
    std::cout << 15 << std::endl;
    printf("Bytes received: %dn", iResult);
    // Echo the buffer back to the clients
    std::cout << 16 << std::endl;
    for (int i = 1; i <= numClients; i++)
    {
    iSendResult = send(ClientSocket[currentNumClients], recvbuf, iResult, 0);
    if (iSendResult == SOCKET_ERROR) {
    std::cout << 17 << std::endl;
    printf("send failed with error: %dn", WSAGetLastError());
    closesocket(ClientSocket[currentNumClients]);
    WSACleanup();
    return 1;
    }
    printf("Bytes sent: %dn", iSendResult);
    }
    }
    else if (iResult == 0) {
    std::cout << 18 << std::endl;
    printf("Connection closing...n");
    break;
    }
    else {
    std::cout << 19 << std::endl;
    printf("recv failed with error: %dn", WSAGetLastError());
    std::cout << "On client #" << currentNumClients << std::endl;
    break;
    }
    }
    iResult = shutdownFunction(ClientSocket[currentNumClients]);
    std::cout << 22 << std::endl;
    // cleanup
    closesocket(ClientSocket[currentNumClients]);
    WSACleanup();
    return 0;
    }
    int shutdownFunction(SOCKET ClientSocket)
    {
    std::cout << 20 << std::endl;
    iResult = shutdown(ClientSocket, SD_SEND);
    if (iResult == SOCKET_ERROR) {
    std::cout << 21 << std::endl;
    printf("shutdown failed with error: %dn", WSAGetLastError());
    closesocket(ClientSocket);
    WSACleanup();
    return 1;
    }
    return 0;
    }
    

    You might notice the different couts, those are just couts to know how the proggram behaves.

    думаю, что у вас просто закончились динамические порты в системе…..

    ошибка (учитывая что изменение max_connection не помогает) формируется вовсе не из за mysql , а из-за невозможности винды предоставить нужное число портов.

    WSAEADDRINUSE
    (10048)
    Address already in use.
    Only one usage of each socket address (protocol/IP address/port) is normally permitted. This error occurs if an application attempts to bind a socket to an IP address/port that has already been used for an existing socket, or a socket that wasn’t closed properly, or one that is still in the process of closing. For server applications that need to bind multiple sockets to the same port number, consider using setsockopt(SO_REUSEADDR). Client applications usually need not call bind at all — connectwill choose an unused port automatically.»

    что в общем случае означает —

    Address already in use (Адрес уже используется).
    Обычно разрешено только одно использование адреса сокета (проткол/адрес IP/порт). Эта ошибка возникает, когда приложение пытается привязаться к сокету функцией bind(), но комбинация адрес IP/порт уже используется существующим сокетом, или сокет не был корректно закрыт, или продолжается процесс закрытия сокета. Для серверных приложений, требующих привязки нескольких сокетов к одному и тому же номеру порта следует использовать setsockopt(SO_REUSEADDR). Клиентские приложения обычно не используют bind() — функция connect() автоматически выбирает неиспользуемый порт.

    В вашем случае, при возрастании числа запросов к базе, когда открывается и закрывается куча подключений к базе, то оти попросту не успевают закрыться. Обратите внимание, что речь идет не о том, чтобы не забыть закрыть подключение mysql, а о том, что ресурсы для НОВОГО подключения освободятся не сразу….

    Если мне память не изменяет, то есть в реестре пара параметров, которые на это влияют.

    один из них — TcpTimedWaitDelay. Этот параметр определяет интервал времени, в течение которого подключение находится в состоянии ожидания, прежде чем будет закрыто. Пока подключение находится в состоянии ожидания, пара сокетов не может быть использована повторно. А согласно RFC793, данное значение должно в два раза превышать максимальное время жизни пакета.
    Если учесть что в Windows XP и Microsoft Windows Server 2003 значение по умолчанию было установлено на 120 секунд, то получается что целых 2 минуты система просто ждет никому не отдавая уже освободившийся ресурс.

    ищем тут

    Код: Выделить всё • Развернуть
    HKLMSYSTEMCurrentControLSetServicesTcpipParametersTcpTimedWaitDelay

    и уменьшаем значение.
    если нет, то создаем
    REG_DWORD – время в секундах , с допустимыми параметрами 30-300 (в десятичной системе)

    и второй параметр это MaxUserPort
    находится он в

    Код: Выделить всё • Развернуть
    HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters

    имеет тип DWORD и допустимые значения от десятичных 5000 (по умолчанию) до 65534

    он определяет максимальный номер порта, который используется, когда программа запрашивает у системы доступный пользовательский порт.

    в итоге изначально имеем в системе всего 5000-1024 = 3976 портов, доступных для приложений, да еще и повторно использовать их можно не чаще раза в 2 минуты…

    отпишитесь, плиз, помогло написанное или нет ?

    p.s. если параметра нет в реестре, то это не значит что он не используется, просто его значение принимается системой по умолчанию…..

    по итогам размышлений над

    http://bugs.mysql.com/bug.php?id=10498

    и

    http://bugs.mysql.com/bug.php?id=6580

    Лучше установить FreeBSD, чем потратить 20 лет на Linux’ы и выяснить какой из них хуже.

    • #1

    1064716b680e4136906e24eaba2b7073.png

    в чом причина?

    TIMEOUT 32
    EthDcrMiner64.exe -ethi 8 -epool eth-cn.dwarfpool.com:80 -ewal 0x6344bbf902c0cec0b0c73704999cccf6e870e248 -epsw x -allcoins -1 -mode 1 -tt 62

    • #2

    Была такая проблема. Помогла перезагрузка

    • #3

    Порт поменяй, ясно же написано

    • #4

    9f1cc1e11b0e465c8854bc0775934a53.png

    теперь вот

    • #5

    Я бы ушел на нанопул, таких проблем у меня там нет, а на дварфе постоянно такое было, то порт не робочий , то с сервером проблемы, но если уходить не хочешь, то смени регион с европы на азию например

    • #6

    Я бы ушел на нанопул, таких проблем у меня там нет, а на дварфе постоянно такое было, то порт не робочий , то с сервером проблемы, но если уходить не хочешь, то смени регион с США на азию например

    я щас да временно на nanopool ушол

    • #7

    сервер страны менял не помогло

    • #8

    Та забей болт, иди на флай.
    А по делу, что то в батнике не то.

    • #9

    eth-ru2.dwarfpool.com:8008 не помогает? -ethi 8 можно убрать (это по умолчанию)

    • #10

    По поводу ошибки первого скрина — добавьте в батник » -mport 0 » (ноль, не О=). По поводу остального, так же смените порт в адресе на — » eth-eu.dwarfpool.com:8008 «

    • #11

    В момент ошибки «bind failed with error: 10048» падает энергопотребление видеокарты до 50-60Вт, это нормально?
    И система подтормаживает?

    • #12

    По поводу ошибки первого скрина — добавьте в батник » -mport 0 » (ноль, не О=). По поводу остального, так же смените порт в адресе на — » eth-eu.dwarfpool.com:8008 »

    Спасибо, мне помогло «мпорт 0».

    • #13

    upload_2018-1-9_0-1-56.png

    батник порт не видит. странно

    • #14

    такая же проблема была, она возникает из-за того, что 2 воркера не могут работать на одном порту

    • #15

    такая же проблема была, она возникает из-за того, что 2 воркера не могут работать на одном порту

    и как решили эту проблему???не хочет проц и карты работать одновременно

    • #16

    Все очень просто, закройте майнинг процессора. Это Claymor не хочет майнить на картах и одновременно на проце. На проц другой майнер

    • #17

    Парни подскажите!? Разбил клеймор на одном риге на несколько батников. Как советовали выше прописал -Мпорт 0 —помогло, ошибки пропали. Но на пуле отражается всего одна карта. Суммарная же вроде как за весь риг. Это нормально? На ФЛАЕ с зеком такого нет, на каждую карту батник и все отражается сразу суммарно….?

    • #18

    Парни подскажите!? Разбил клеймор на одном риге на несколько батников. Как советовали выше прописал -Мпорт 0 —помогло, ошибки пропали. Но на пуле отражается всего одна карта. Суммарная же вроде как за весь риг. Это нормально? На ФЛАЕ с зеком такого нет, на каждую карту батник и все отражается сразу суммарно….?

    на флае у тебя другой майнер сто пудов там хоть 10 карт по отдельности запускай , а клеймор занимает порт — два не будет работать

    Понравилась статья? Поделить с друзьями:
  • Ошибка 1004 приора
  • Ошибка 10020 dhcp
  • Ошибка 1004 fanuc
  • Ошибка 1002 что это
  • Ошибка 1004 excel 2010