/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* This class defines the plain DatagramSocketImpl that is used on
* Windows platforms greater than or equal to Windows Vista. These
* and IPV6 through a single file descriptor.
* <p>
* TwoStacksPlainDatagramSocketImpl. This is to overcome the lack
* of behavior defined for multicasting over a dual layer socket by the RFC.
*
* @author Chris Hegarty
*/
{
// true if this socket is exclusively bound
private final boolean exclusiveBind;
/*
* Set to true if SO_REUSEADDR is set after the socket is bound to
* indicate SO_REUSEADDR is being emulated
*/
private boolean reuseAddressEmulated;
// emulates SO_REUSEADDR when exclusiveBind is true and socket is bound
private boolean isReuseAddress;
}
throw new SocketException("Socket closed");
}
throws SocketException {
int nativefd = checkAndReturnNativeFD();
throw new NullPointerException("argument address");
if (lport == 0) {
} else {
}
}
int nativefd = checkAndReturnNativeFD();
throw new NullPointerException("Null address in peek()");
// Use peekData()
return peekPort;
}
int nativefd = checkAndReturnNativeFD();
if (p == null)
throw new NullPointerException("packet");
throw new NullPointerException("packet buffer");
}
int nativefd = checkAndReturnNativeFD();
if (p == null)
throw new NullPointerException("packet");
throw new NullPointerException("packet buffer");
}
int nativefd = checkAndReturnNativeFD();
if (p == null)
throw new NullPointerException("null packet");
throw new NullPointerException("null address || null buffer");
}
int nativefd = checkAndReturnNativeFD();
throw new NullPointerException("address");
}
return; // disconnect doesn't throw any exceptions
}
protected void datagramSocketClose() {
return; // close doesn't throw any exceptions
}
@SuppressWarnings("fallthrough")
int nativefd = checkAndReturnNativeFD();
int optionValue = 0;
switch(opt) {
case IP_TOS :
case SO_RCVBUF :
case SO_SNDBUF :
break;
case SO_REUSEADDR :
// socket already bound, emulate SO_REUSEADDR
reuseAddressEmulated = true;
return;
}
//Intentional fallthrough
case SO_BROADCAST :
break;
default: /* shouldn't get here */
throw new SocketException("Option not supported");
}
}
int nativefd = checkAndReturnNativeFD();
// SO_BINDADDR is not a socket option.
if (opt == SO_BINDADDR) {
return socketLocalAddress(nativefd);
}
return isReuseAddress;
switch (opt) {
case SO_REUSEADDR :
case SO_BROADCAST :
break;
case IP_TOS :
case SO_RCVBUF :
case SO_SNDBUF :
break;
default: /* shouldn't get here */
throw new SocketException("Option not supported");
}
return returnValue;
}
/* Multicast specific methods.
* TwoStacksPlainDatagramSocketImpl. This is to overcome the lack
* of behavior defined for multicasting over a dual layer socket by the RFC.
*/
throws IOException {
throw new IOException("Method not implemented!");
}
throws IOException {
throw new IOException("Method not implemented!");
}
throw new IOException("Method not implemented!");
}
throw new IOException("Method not implemented!");
}
throw new IOException("Method not implemented!");
}
throw new IOException("Method not implemented!");
}
/* END Multicast specific methods */
throw new SocketException("Socket closed");
}
/* Native methods */
private static native void initIDs();
throws SocketException;
int optionValue) throws SocketException;
}