test/jdk/sun/security/ssl/SSLSocketImpl/NewSocketMethods.java
branchniosocketimpl-branch
changeset 57341 733e9746d615
parent 47216 71c04702a3d5
equal deleted inserted replaced
57340:9026cb618cdd 57341:733e9746d615
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   195             OutputStream os = socket.getOutputStream();
   195             OutputStream os = socket.getOutputStream();
   196 
   196 
   197             /**
   197             /**
   198              * test some new methods of java.net.Socket added to merlin.
   198              * test some new methods of java.net.Socket added to merlin.
   199              */
   199              */
   200             socket.setTrafficClass(8);
       
   201             socket.setReuseAddress(true);
       
   202             System.out.println("Client getTrafficClass(): "
       
   203                         + socket.getTrafficClass());
       
   204             System.out.println("Client isInputShutdown() "
   200             System.out.println("Client isInputShutdown() "
   205                         + socket.isInputShutdown());
   201                         + socket.isInputShutdown());
       
   202             socket.setReuseAddress(true);
   206             System.out.println("Client getReuseAddress(): "
   203             System.out.println("Client getReuseAddress(): "
   207                         + socket.getReuseAddress());
   204                         + socket.getReuseAddress());
       
   205 
       
   206             // Solaris does not support set/get of IPV6_TCLASS when connected
       
   207             if (!"SunOS".equals(System.getProperty("os.name"))) {
       
   208                 socket.setTrafficClass(8);
       
   209                 System.out.println("Client getTrafficClass(): "
       
   210                         + socket.getTrafficClass());
       
   211             }
       
   212 
   208             os.write(237);
   213             os.write(237);
   209             os.flush();
   214             os.flush();
   210             System.out.println("Client read: " + is.read());
   215             System.out.println("Client read: " + is.read());
   211             socket.close();
   216             socket.close();
   212             System.out.println("Client isOutputShutdown() "
   217             System.out.println("Client isOutputShutdown() "