diff --git a/network/netplay/netplay.c b/network/netplay/netplay.c index 3b0cd659c5..142d08e280 100644 --- a/network/netplay/netplay.c +++ b/network/netplay/netplay.c @@ -829,7 +829,8 @@ static int init_tcp_connection(const struct addrinfo *res, #if defined(IPPROTO_TCP) && defined(TCP_NODELAY) { int flag = 1; - setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (void*)&flag, sizeof(int)); + if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (void*)&flag, sizeof(int)) < 0) + RARCH_WARN("Could not set netplay TCP socket to nodelay. Expect jitter.\n"); } #endif diff --git a/network/netplay/netplay_common.c b/network/netplay/netplay_common.c index 7bb5b09789..287bf88912 100644 --- a/network/netplay/netplay_common.c +++ b/network/netplay/netplay_common.c @@ -99,20 +99,22 @@ uint32_t netplay_impl_magic(void) runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &info); - if (info) - lib = info->info.library_name; - res |= api; - len = strlen(lib); - for (i = 0; i < len; i++) - res ^= lib[i] << (i & 0xf); + if (info) + { + lib = info->info.library_name; - lib = info->info.library_version; - len = strlen(lib); + len = strlen(lib); + for (i = 0; i < len; i++) + res ^= lib[i] << (i & 0xf); - for (i = 0; i < len; i++) - res ^= lib[i] << (i & 0xf); + lib = info->info.library_version; + len = strlen(lib); + + for (i = 0; i < len; i++) + res ^= lib[i] << (i & 0xf); + } len = strlen(ver); for (i = 0; i < len; i++) diff --git a/network/netplay/netplay_net.c b/network/netplay/netplay_net.c index 4138ca80c9..d2520a6ca7 100644 --- a/network/netplay/netplay_net.c +++ b/network/netplay/netplay_net.c @@ -115,7 +115,8 @@ static bool netplay_net_pre_frame(netplay_t *netplay) #if defined(IPPROTO_TCP) && defined(TCP_NODELAY) { int flag = 1; - setsockopt(netplay->fd, IPPROTO_TCP, TCP_NODELAY, (void*)&flag, sizeof(int)); + if (setsockopt(netplay->fd, IPPROTO_TCP, TCP_NODELAY, (void*)&flag, sizeof(int)) < 0) + RARCH_WARN("Could not set netplay TCP socket to nodelay. Expect jitter.\n"); } #endif