dragonwell-project / dragonwell8

Alibaba Dragonwell8 JDK
http://dragonwell-jdk.io
GNU General Public License v2.0
4.21k stars 497 forks source link

[Wisp] Keep aligning Socket.isConnected() with the normal OpenJDK returning result #438

Closed zhengxiaolinX closed 2 years ago

zhengxiaolinX commented 2 years ago

Summary: Socket.connect() in Wisp's implementation, uses nio SocketChannel's logic to prevent blocking when Socket is used. However, OpenJDK's isConnected() returns true after successfully connecting even if the socket gets closed. This will break consistency so we shall fix this.

Test Plan: newly-added ServerSocketConnectionTest.java

Reviewed-by: D-D-H

Issue: #437

zhengxiaolinX commented 2 years ago

@D-D-H May want to take a look? Thank you.

zhengxiaolinX commented 2 years ago

Tests passed.

good

My pleasure to get a review from you. @D-D-H

This patch only affects Wisp and the impact is low. One reviewer is enough.

/reviewers 1

Gotta go.