Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 support! #109

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Fix some "oopsies"
Those lines don't belong in this PR
Jérôme Leclercq committed Jun 3, 2019
commit cf2687f2e3741599185ec573ac7296ce34bfd8ed
4 changes: 2 additions & 2 deletions include/enet/enet.h
Original file line number Diff line number Diff line change
@@ -645,8 +645,8 @@ extern void enet_peer_on_disconnect (ENetPeer *);

ENET_API void * enet_range_coder_create (void);
ENET_API void enet_range_coder_destroy (void *);
ENET_API size_t enet_range_coder_compress (void *, const ENetPeer * peer, const ENetBuffer *, size_t, size_t, enet_uint8 *, size_t);
ENET_API size_t enet_range_coder_decompress (void *, const ENetPeer * peer, const enet_uint8 *, size_t, enet_uint8 *, size_t);
ENET_API size_t enet_range_coder_compress (void *, const ENetBuffer *, size_t, size_t, enet_uint8 *, size_t);
ENET_API size_t enet_range_coder_decompress (void *, const enet_uint8 *, size_t, enet_uint8 *, size_t);

extern size_t enet_protocol_command_size (enet_uint8);

10 changes: 4 additions & 6 deletions win32.c
Original file line number Diff line number Diff line change
@@ -183,7 +183,7 @@ enet_address_set_host(ENetAddress * address, ENetAddressType type, const char *
struct addrinfo hints;
struct addrinfo* result;
struct addrinfo* resultList = NULL;
enet_uint16 port;
enet_uint16 port;
ENetAddress tempAddress;
int bestScore = -1;

@@ -441,8 +441,7 @@ enet_socket_send (ENetSocket socket,
NULL,
NULL) == SOCKET_ERROR)
{
int lastErr = WSAGetLastError();
if (lastErr == WSAEWOULDBLOCK)
if (WSAGetLastError() == WSAEWOULDBLOCK)
return 0;

return -1;
@@ -468,12 +467,11 @@ enet_socket_receive (ENetSocket socket,
& recvLength,
& flags,
address != NULL ? (struct sockaddr *) & sockAddrBuf : NULL,
address != NULL ? &socketAddressLen : NULL,
address != NULL ? & socketAddressLen : NULL,
NULL,
NULL) == SOCKET_ERROR)
{
int lastErr = WSAGetLastError();
switch (lastErr)
switch (WSAGetLastError())
{
case WSAEWOULDBLOCK:
case WSAECONNRESET: