forked from dragonwell-project/dragonwell17
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Wisp] Socket.getChannel() should return null.
Summary: Changing the return value of Socket.getChannel() will affect the correctness of some libraries. For example, Apache geode tests whether it is a nio adaptor channel through the return value of getChannel(). Test Plan: SocketGetChannelTest Reviewed-by: yulei Issue: dragonwell-project#140
- Loading branch information
Showing
6 changed files
with
48 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* @test | ||
* @library /test/lib | ||
* @summary test Socket.getChannel returns null | ||
* @requires os.family == "linux" | ||
* @modules java.base/jdk.internal.access | ||
* @modules java.base/com.alibaba.wisp.engine:+open | ||
* @run main SocketGetChannelTest | ||
* @run main/othervm -XX:+UseWisp2 SocketGetChannelTest | ||
*/ | ||
|
||
import java.net.ServerSocket; | ||
import java.net.Socket; | ||
|
||
import static jdk.test.lib.Asserts.assertNull; | ||
|
||
public class SocketGetChannelTest { | ||
public static void main(String[] args) throws Exception { | ||
ServerSocket ss = new ServerSocket(0); | ||
Socket s1 = new Socket("localhost", ss.getLocalPort()); | ||
Socket s2 = ss.accept(); | ||
assertNull(ss.getChannel()); | ||
assertNull(s1.getChannel()); | ||
assertNull(s2.getChannel()); | ||
} | ||
} |