jdk/src/java.base/share/classes/sun/nio/ch/SocketAdaptor.java
changeset 29224 8433f5f46142
parent 25859 3317bb8137f4
child 34774 03b4e6dc367b
equal deleted inserted replaced
29223:a9f00e8ae58b 29224:8433f5f46142
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2015, 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.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   319     public int getSoLinger() throws SocketException {
   319     public int getSoLinger() throws SocketException {
   320         return getIntOption(StandardSocketOptions.SO_LINGER);
   320         return getIntOption(StandardSocketOptions.SO_LINGER);
   321     }
   321     }
   322 
   322 
   323     public void sendUrgentData(int data) throws IOException {
   323     public void sendUrgentData(int data) throws IOException {
   324         synchronized (sc.blockingLock()) {
   324         int n = sc.sendOutOfBandData((byte) data);
   325             if (!sc.isBlocking())
   325         if (n == 0)
   326                 throw new IllegalBlockingModeException();
   326             throw new IOException("Socket buffer full");
   327             int n = sc.sendOutOfBandData((byte)data);
       
   328             assert n == 1;
       
   329         }
       
   330     }
   327     }
   331 
   328 
   332     public void setOOBInline(boolean on) throws SocketException {
   329     public void setOOBInline(boolean on) throws SocketException {
   333         setBooleanOption(ExtendedSocketOption.SO_OOBINLINE, on);
   330         setBooleanOption(ExtendedSocketOption.SO_OOBINLINE, on);
   334     }
   331     }