From c42cae333df0c3eb0f78aa2ff4de4d1a96981b43 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 4 Mar 2016 03:19:19 -0500 Subject: [PATCH] Send a best-effort disconnect event to let GFE know that we're gone. This increases reconnect reliability. --- limelight-common/ControlStream.c | 2 +- limelight-common/RtspConnection.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/limelight-common/ControlStream.c b/limelight-common/ControlStream.c index 8228658..952a9ce 100644 --- a/limelight-common/ControlStream.c +++ b/limelight-common/ControlStream.c @@ -524,7 +524,7 @@ int stopControlStream(void) { PltSetEvent(&invalidateRefFramesEvent); if (peer != NULL) { - enet_peer_reset(peer); + enet_peer_disconnect_now(peer, 0); } if (ctlSock != INVALID_SOCKET) { diff --git a/limelight-common/RtspConnection.c b/limelight-common/RtspConnection.c index ccbd543..9b48adb 100644 --- a/limelight-common/RtspConnection.c +++ b/limelight-common/RtspConnection.c @@ -281,7 +281,7 @@ void terminateRtspHandshake(void) { } if (peer != NULL) { - enet_peer_reset(peer); + enet_peer_disconnect_now(peer, 0); peer = NULL; } @@ -626,7 +626,7 @@ int performRtspHandshake(void) { // Cleanup the ENet stuff if (ServerMajorVersion >= 5) { if (peer != NULL) { - enet_peer_reset(peer); + enet_peer_disconnect_now(peer, 0); peer = NULL; }