You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It can run in VS2019, but when called in QT (5.14.1), enet_host_create cannot produce a server.
This is my code.
if (enet_initialize() != 0) {
printf("An error occurred while initializing ENet.\n");
}
ENetAddress address = { 0 };
//address.host = ENET_HOST_ANY; /* Bind the server to the default localhost. */
enet_address_set_host(&address, "127.0.0.1");
address.port = 7777; /* Bind the server to port 7777. */
#define MAX_CLIENTS 32
/* create a server */
ENetHost* server = enet_host_create(&address, MAX_CLIENTS, 2, 0, 0);
if (server == NULL) {
printf("An error occurred while trying to create an ENet server host.\n");
return 1;
} else {
printf("Started a server...\n");
}
Why is sever null?
I've tried two compiler methods of MSVC2015_64bit-Debug and MinGW_32_bit-Debug.
I traced the code bind(socket, (struct sockaddr *)&sin, sizeof(struct sockaddr_in6)) and found the error code to be 10049 by WSAGetLastError().
How to fix this in QT?
The text was updated successfully, but these errors were encountered:
It can run in VS2019, but when called in QT (5.14.1),
enet_host_create
cannot produce a server.This is my code.
Why is sever null?
I've tried two compiler methods of
MSVC2015_64bit-Debug
andMinGW_32_bit-Debug
.I traced the code
bind(socket, (struct sockaddr *)&sin, sizeof(struct sockaddr_in6))
and found the error code to be10049
byWSAGetLastError()
.How to fix this in QT?
The text was updated successfully, but these errors were encountered: