Skip to content

Commit 122fce7

Browse files
committed
prevented unnecessary IOException
1 parent ec4c9a2 commit 122fce7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/org/java_websocket/SSLSocketChannel2.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ public boolean isConnected() {
197197
public void close() throws IOException {
198198
sslEngine.closeOutbound();
199199
sslEngine.getSession().invalidate();
200-
int wr = sc.write( wrap( emptybuffer ) );
200+
if( sc.isOpen() )
201+
sc.write( wrap( emptybuffer ) );// FIXME what if not all bytes can be written
201202
sc.close();
202203
}
203204

0 commit comments

Comments
 (0)