From 341174826c84504da29333c7585dd97fa5657a72 Mon Sep 17 00:00:00 2001 From: Alexis Maiquez Murcia Date: Tue, 16 Feb 2021 23:10:41 +0100 Subject: [PATCH] ~ update EVESharp dependencies to fix a infinite loop issue with BeginReceive Signed-off-by: Alexis Maiquez Murcia --- Editor/LiveClient.cs | 28 ++-------------------------- Editor/MainWindow.cs | 5 ++--- External/EVESharp | 2 +- 3 files changed, 5 insertions(+), 30 deletions(-) diff --git a/Editor/LiveClient.cs b/Editor/LiveClient.cs index 48d7b3f..bda960e 100644 --- a/Editor/LiveClient.cs +++ b/Editor/LiveClient.cs @@ -24,8 +24,8 @@ public LiveClient(int index, EVEClientSocket socket, EVEClientSocket serverSocke this.mServerSocket.SetReceiveCallback(ServerReceive); this.mClientSocket.SetReceiveCallback(ClientReceive); // setup connection close callbacks - this.mServerSocket.SetOnConnectionLostHandler(OnConnectionLost); - this.mClientSocket.SetOnConnectionLostHandler(OnConnectionLost); + this.mServerSocket.SetOnConnectionLostHandler(Stop); + this.mClientSocket.SetOnConnectionLostHandler(Stop); } private void ServerReceive(PyDataType data) @@ -70,7 +70,6 @@ private void ClientReceive(PyDataType data) }; // try to parse a PyPacket, if it fails just store the raw data - try { entry.Packet = data; @@ -84,28 +83,6 @@ private void ClientReceive(PyDataType data) this.mMainWindow.OnPacketReceived(entry); } - private void OnConnectionLost() - { - // forcefully disconnect sockets - try - { - this.mClientSocket.ForcefullyDisconnect(); - } - catch (Exception) - { - // ignored - } - - try - { - this.mServerSocket.ForcefullyDisconnect(); - } - catch (Exception) - { - // ignored - } - } - public void Stop() { // forcefully disconnect sockets @@ -126,7 +103,6 @@ public void Stop() { // ignored } - } } } \ No newline at end of file diff --git a/Editor/MainWindow.cs b/Editor/MainWindow.cs index 69b8619..86bacab 100644 --- a/Editor/MainWindow.cs +++ b/Editor/MainWindow.cs @@ -72,11 +72,10 @@ public void ServerConnectionAccept(IAsyncResult ar) { try { - EVEBridgeServer server = ar.AsyncState as EVEBridgeServer; - EVEClientSocket client = server.EndAccept(ar); + EVEClientSocket client = this.mServer.EndAccept(ar); // open a connection to the server to relay info from this client - EVEClientSocket serverSocket = new EVEClientSocket(server.Log); + EVEClientSocket serverSocket = new EVEClientSocket(this.mServer.Log); serverSocket.Connect(this.mServerAddress, this.mServerPort); LiveClient newLiveClient = new LiveClient(this.mClients.Count, client, serverSocket, this); diff --git a/External/EVESharp b/External/EVESharp index 38646ad..e91f854 160000 --- a/External/EVESharp +++ b/External/EVESharp @@ -1 +1 @@ -Subproject commit 38646ad0ec9082b98d7b641b37b33d2a01a09a2c +Subproject commit e91f854bf4f6daafedd861b7efadfc61ed78d8d1