Moved exit function to catch block and removed sync which was blocking create thread and thus render loop

This commit is contained in:
Collin Smith
2020-06-24 20:15:48 -07:00
parent 8eee5fd8f3
commit 3dc8136462
4 changed files with 4 additions and 7 deletions

View File

@ -61,12 +61,11 @@ public class TestClient extends ApplicationAdapter implements PacketProcessor {
ChannelFuture f = b.connect("localhost", TestServer.PORT).sync(); ChannelFuture f = b.connect("localhost", TestServer.PORT).sync();
sendPacket(); sendPacket();
f.channel().closeFuture().sync();
} catch (Throwable t) { } catch (Throwable t) {
Gdx.app.error(TAG, t.getMessage(), t); Gdx.app.error(TAG, t.getMessage(), t);
Gdx.app.exit();
} finally { } finally {
group.shutdownGracefully(); group.shutdownGracefully();
Gdx.app.exit();
} }
} }

View File

@ -62,12 +62,11 @@ public class TestServer extends ApplicationAdapter implements PacketProcessor {
; ;
ChannelFuture f = b.bind(PORT).sync(); ChannelFuture f = b.bind(PORT).sync();
f.channel().closeFuture().sync();
} catch (Throwable t) { } catch (Throwable t) {
Gdx.app.error(TAG, t.getMessage(), t); Gdx.app.error(TAG, t.getMessage(), t);
Gdx.app.exit();
} finally { } finally {
group.shutdownGracefully(); group.shutdownGracefully();
Gdx.app.exit();
} }
} }

View File

@ -63,12 +63,11 @@ public class TestClient extends ApplicationAdapter implements PacketProcessor {
ChannelFuture f = b.connect("localhost", TestServer.PORT).sync(); ChannelFuture f = b.connect("localhost", TestServer.PORT).sync();
sendPacket(); sendPacket();
f.channel().closeFuture().sync();
} catch (Throwable t) { } catch (Throwable t) {
Gdx.app.error(TAG, t.getMessage(), t); Gdx.app.error(TAG, t.getMessage(), t);
Gdx.app.exit();
} finally { } finally {
workerGroup.shutdownGracefully(); workerGroup.shutdownGracefully();
Gdx.app.exit();
} }
} }

View File

@ -62,10 +62,10 @@ public class TestServer extends ApplicationAdapter implements PacketProcessor {
f.channel().closeFuture().sync(); f.channel().closeFuture().sync();
} catch (Throwable t) { } catch (Throwable t) {
Gdx.app.error(TAG, t.getMessage(), t); Gdx.app.error(TAG, t.getMessage(), t);
Gdx.app.exit();
} finally { } finally {
workerGroup.shutdownGracefully(); workerGroup.shutdownGracefully();
bossGroup.shutdownGracefully(); bossGroup.shutdownGracefully();
Gdx.app.exit();
} }
} }