File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed
src/de/javasocketapi/core Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change 33import java .io .IOException ;
44import java .io .OutputStream ;
55import java .net .Socket ;
6+ import java .net .SocketException ;
67import java .util .LinkedList ;
78import java .util .List ;
89import java .util .Timer ;
@@ -69,20 +70,26 @@ public void run() {
6970 //initialise packet
7071 packet .send (writingByteBuffer );
7172 }
72- //receive bytes
73- byte [] bytes = writingByteBuffer .toBytes ();
74- //check if outputstream is null
75- assert finalOutputStream != null ;
76- //write bytes length
77- finalOutputStream .write (bytes .length );
78- //write bytes
79- finalOutputStream .write (bytes );
80- //flush outputStream
81- finalOutputStream .flush ();
73+ try {
74+ //receive bytes
75+ byte [] bytes = writingByteBuffer .toBytes ();
76+ //check if outputstream is null
77+ assert finalOutputStream != null ;
78+ //write bytes length
79+ finalOutputStream .write (bytes .length );
80+ //write bytes
81+ finalOutputStream .write (bytes );
82+ //flush outputStream
83+ finalOutputStream .flush ();
84+ } catch (SocketException ignored ) {
85+
86+ }
8287 }
8388 }
8489 } catch (IOException e ) {
8590 e .printStackTrace ();
91+ } catch (NullPointerException ignored ) {
92+
8693 }
8794 }
8895 }, 0 , 1 );
You can’t perform that action at this time.
0 commit comments