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
When I attempt to build ggpo as a .dll and .lib file to use as a dependency for my own project, I end up receiving the following error below:
Looking at the code snippet below (udp.cpp):
voidUdp::SendTo(char *buffer, int len, int flags, structsockaddr *dst, int destlen)
{
structsockaddr_in *to = (structsockaddr_in *)dst;
int res = sendto(_socket, buffer, len, flags, dst, destlen);
if (res == SOCKET_ERROR) {
DWORD err = WSAGetLastError();
Log("unknown error in sendto (erro: %d wsaerr: %d).\n", res, err);
ASSERT(FALSE && "Unknown error in sendto");
}
char dst_ip[1024];
Log("sent packet length %d to %s:%d (ret:%d).\n", len, inet_ntop(AF_INET, (void *)&to->sin_addr, dst_ip, ARRAY_SIZE(dst_ip)), ntohs(to->sin_port), res);
}
I end up getting a SOCKET_ERROR when the sendto(...) function is called. It turns out the error I get back is error code: 10093. Based on Microsoft's documentation, error code https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2, error code 10093 means that Win Sockets dependency hasn't been initialized yet.
Steps to Reproduce:
The following simplified code will reproduce the issue:
// assume callbacks, game state, non game state, and port numbers are already defined somewhere elseconstint NUM_PLAYERS = 2;
GGPOSession *ggpo = NULL;
GGPOSessionCallbacks cb = { 0 };
cb.begin_game = vw_begin_game_callback;
cb.advance_frame = vw_advance_frame_callback;
cb.load_game_state = vw_load_game_state_callback;
cb.save_game_state = vw_save_game_state_callback;
cb.free_buffer = vw_free_buffer;
cb.on_event = vw_on_event_callback;
cb.log_game_state = vw_log_game_state;
ggpo_start_session(&ggpo, &cb, "rollback_tech_demo", NUM_PLAYERS, sizeof(int), localPort);
ggpo_set_disconnect_timeout(ggpo, 3000);
ggpo_set_disconnect_notify_start(ggpo, 1000);
// Calls to ggpo_add_player() made but omitted to keep simpleint maxTimeIdleMillis = 6;
ggpo_idle(ggpo, maxTimeIdleMillis);
// sends input request over the network using UDP protocol internally// Looks like this fails because Winsockets hasn't been initialized yet.ggpo_add_local_input(ggpo, ngs.local_player_handle, &localInputsThisFrame, sizeof(localInputsThisFrame));
ggpo_synchronize_input(ggpo, (void *)allInputs, sizeof(int) * NUM_PLAYERS, &disconnectFlags);
ggpo_advance_frame(ggpo);
The text was updated successfully, but these errors were encountered:
Dependencies Used
Summary
When I attempt to build ggpo as a
.dll
and.lib
file to use as a dependency for my own project, I end up receiving the following error below:Looking at the code snippet below (
udp.cpp
):I end up getting a
SOCKET_ERROR
when thesendto(...)
function is called. It turns out the error I get back is error code: 10093. Based on Microsoft's documentation, error code https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2, error code 10093 means that Win Sockets dependency hasn't been initialized yet.Steps to Reproduce:
The text was updated successfully, but these errors were encountered: