From 8cf701d4085d4489b1189d8612534076ce68c989 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Thu, 16 Nov 2023 20:49:18 -0500 Subject: [PATCH] i came in ur dad --- .../ChunkedCompressedChecksumFileReader.java | 20 +++++++++--------- src/main/java/server/Connection.java | 3 ++- src/main/java/server/Server.java | 10 +++++++-- .../ChunkedCompressedChecksumFileReader.class | Bin 4133 -> 5236 bytes target/classes/server/Connection.class | Bin 4744 -> 4281 bytes target/classes/server/Server$1.class | Bin 1347 -> 1343 bytes target/classes/server/Server.class | Bin 3794 -> 3888 bytes 7 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/main/java/server/ChunkedCompressedChecksumFileReader.java b/src/main/java/server/ChunkedCompressedChecksumFileReader.java index 5f2b378..8593a7c 100644 --- a/src/main/java/server/ChunkedCompressedChecksumFileReader.java +++ b/src/main/java/server/ChunkedCompressedChecksumFileReader.java @@ -28,23 +28,23 @@ public class ChunkedCompressedChecksumFileReader { } public FileHeader readChunk(Tracer trace, Span sp) throws IOException { - //Span gf = trace.spanBuilder("Chunk Read").setParent(Context.current().with(sp)).startSpan(); + Span gf = trace.spanBuilder("Chunk Read").setParent(Context.current().with(sp)).startSpan(); FileHeader header = readHeader(); - //try (Scope scope = gf.makeCurrent()) { + try (Scope scope = gf.makeCurrent()) { if (header.getUncompressed() == 0) return header; - sp.addEvent("Read Data"); + gf.addEvent("Read Data"); byte[] data = readSome(header); - sp.addEvent("Decompress Data"); + gf.addEvent("Decompress Data"); byte[] decompressed = decompress(header, data); - sp.addEvent("Hash"); + gf.addEvent("Hash"); hash(header, decompressed); - sp.addEvent("Write"); + gf.addEvent("Write"); fileOutputWriter.write(decompressed, 0, decompressed.length); - sp.addEvent("End"); -// } finally { -// gf.end(); -// } + gf.addEvent("End"); + } finally { + gf.end(); + } return header; } diff --git a/src/main/java/server/Connection.java b/src/main/java/server/Connection.java index ca484fd..69f0b8e 100644 --- a/src/main/java/server/Connection.java +++ b/src/main/java/server/Connection.java @@ -44,7 +44,6 @@ public class Connection implements Runnable { try (Scope scope = fileSend.makeCurrent()) { int filesReceived = 0; while (server.isRunning()) { - System.out.println("Hello " + clientSocket.isConnected()); if (!clientSocket.isConnected()) { System.out.println("Client Disconnected"); break; @@ -78,6 +77,8 @@ public class Connection implements Runnable { in.close(); clientSocket.close(); } catch (Exception ignored) {} + Server.running = false; + Server.close(); } } diff --git a/src/main/java/server/Server.java b/src/main/java/server/Server.java index b5efc3f..99ed41e 100644 --- a/src/main/java/server/Server.java +++ b/src/main/java/server/Server.java @@ -21,7 +21,7 @@ public class Server { public static final int SERVER_PORT = 42069; - private volatile boolean running = true; + public static volatile boolean running = true; private static final OpenTelemetry ot = OTelUtils.create(); @@ -67,8 +67,14 @@ public class Server { return running; } + private static Server srv; + public static void main(String[] args) { - new Server(); + srv = new Server(); + } + + public static void close(){ + srv.notifyAll(); } } \ No newline at end of file diff --git a/target/classes/server/ChunkedCompressedChecksumFileReader.class b/target/classes/server/ChunkedCompressedChecksumFileReader.class index 6c61c2c264767412a1f75eb673f598b226816603..594e896c078f9e587b8e1b3b1a8404f6a85723f8 100644 GIT binary patch literal 5236 zcmbVP33waD75+z(y|S{2gCHRaIpiF~mMtp<$23-e#EygQIB~Fpi4zLlNSj!(EUD5e z2fd&-y+SE1B`pPdrFTOh3Lzn(7j2<;DZOZ+>0NqX6w39_>`JmD0r~oUwq|#B=Dq*D z_rLdM9(eYi;{Yxc@WBPQ29J&!)Cx@BVeB*_Nh7sAGO%@r8M6dxS0qvi>mmVnW7BXQ zyr|RQ(=i3QKqzNscbeHq*JwU9X2!eH&6W>(I3Cx=4q=CFu@{)$2z?|aO&iuA*CY>~S#ezw3B|_Ta!y+u!aITIeXk=`ZgcPH& zjqZ(XFs#uWBfi}v0ium|h!iXA-O(+TQ%&~NBpFc+p(6Owhk=Zl8pv3QbjpVogf+D4 zh+t_22pMRCsHgiU+9Pm@1E?fX!Yx87O_tR}9cZ*}q99UXKF*WGKVKl=$UJpT)36V7 z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I|EbtWMNhV0E8S4&j0`b delta 130 zcmdnbb(m{IIg9vw24)5(1_lPRO$?$!(%TqhwYD%YGH;#S#iAXh$e_WX&0qsm;R;lt z#=r?CIT+L#1b{M<44MpzKzR)YJs_zAgt`o-4EhXiKviNuGj)LKy%@Y17(u2pxHEVF QX&)eFXJE>n%+G2700h4e=l}o! diff --git a/target/classes/server/Server.class b/target/classes/server/Server.class index ed8321efaf3c942b3495ab8becd889b59390ee44..996c1a4a278c74e46020513431db138cc1e6d872 100644 GIT binary patch delta 1462 zcmZ9LTWnNS6o$V&bEbPPhk*`MdhY-gd$Y8*^eV_rp|vfvrO={9Dio;HDNbu6Pt_O_ z5)&dhPa4z+ctKI=RHrjk(W0Q%J8B3IYQzTtFx6?8`Z4 zbNy3)ojVV#;`?L%mSYD?3WJJ3b5CC++};}3+xPHc*{U^$Rjc3JJk^&pIbG{ zO>Uz=v0PBItX&?%N_Ta7^C>bZro?*8RT(U0g{I7;oI4bGH|?&vRt73rsi`ulrpC%} zSA^>n^Bp>Uk$vGoCl5b&vP!esY!*CC_%%YUQTwLBpWSKJ4=G;jhId2Y zZQjwuO~y%#HTZ(c>hoV8@yG;37?2)kkmMYS3E8`7r@>A@_L&4QMfz=SB0XZ`Aw|}A z#jp`AKlrm~92G-{=7r`bNp;gy99o5lfORGX%d-(Oi<`c125!icoF5gZh%t z+63!kY)sPZVfzHFU7_}Iw$>R5TkGyBD#$Xc4kx&Blv=Lu4n8kVq;rL?h(-7@tDsNfMQM|g@V2~;hi@+3e# z=Vi1fMZX{}Q`Ab3dcKphD;8b8T}iq5qm^S5#ZIl&j%8?j3a_@0k`~3 zKI9|WN$I)hG$vKNFY&Q7rjW~we8Q*F$0;%Bz&9VTj7S$FcFpW5f%Q%*=8VBCS)Wk- zLQZ6cq!cdaE--<&Yn&IyI5FyA*bw&ABg5#YaSlvCs`r(g`*`A?QIzuA!9d425ohFO z8$&s*o55%n%NBWMU*Ghop7mHPlNRT6f;YzKH^$hXU~CNiFF?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