/*
* 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 for all
* Windows versions lower than Vista. It adds support for IPv6 on
* these platforms where available.
*
* For backward compatibility windows platforms that do not have IPv6
* support also use this implementation, and fd1 gets set to null
* during socket creation.
*
* @author Chris Hegarty
*/
{
/* Used for IPv6 on Windows only */
/*
* Needed for ipv6 on windows because we need to know
* if the socket was bound to ::0 or 0.0.0.0, when a caller
* asks for it. In this case, both sockets are used, but we
* don't know whether the caller requested ::0 or 0.0.0.0
* and need to remember it here.
*/
/* saved between successive calls to receive, if data is detected
* on both sockets at same time. To ensure that one socket is not
* starved, they rotate using this field
*/
static {
init();
}
// 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;
}
fd1 = new FileDescriptor();
try {
super.create();
} catch (SocketException e) {
throw e;
}
}
throws SocketException {
if (laddr.isAnyLocalAddress()) {
}
}
throws SocketException
{
}
throws IOException {
try {
receive0(p);
} finally {
fduse = -1;
}
}
if (isClosed()) {
throw new SocketException("Socket Closed");
}
if (optID == SO_BINDADDR) {
return anyLocalBoundAddr;
}
return socketGetOption(optID);
return isReuseAddress;
} else {
}
}
throws SocketException
{
// socket already bound, emulate
reuseAddressEmulated = true;
} else {
}
}
protected boolean isClosed() {
}
protected void close() {
}
}
/* Native methods */
boolean exclBind)
throws SocketException;
throws IOException;
throws IOException;
throws IOException;
protected native void datagramSocketClose();
throws SocketException;
/**
* Perform class load-time initializations.
*/
private native static void init();
}