/*
* 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 SocketImpl that is used on Windows platforms
* greater or equal to Windows Vista. These platforms have a dual
* single file descriptor.
*
* @author Chris Hegarty
*/
{
// true if this socket is exclusively bound
private final boolean exclusiveBind;
// emulates SO_REUSEADDR when exclusiveBind is true
private boolean isReuseAddress;
}
}
throw new SocketException("Socket closed");
}
throws IOException {
int nativefd = checkAndReturnNativeFD();
throw new NullPointerException("inet address argument is null.");
int connectResult;
if (timeout <= 0) {
} else {
configureBlocking(nativefd, false);
try {
if (connectResult == WOULDBLOCK) {
}
} finally {
configureBlocking(nativefd, true);
}
}
/*
* We need to set the local port field. If bind was called
* previous to the connect (by the client) then localport field
* will already be set.
*/
if (localport == 0)
}
int nativefd = checkAndReturnNativeFD();
throw new NullPointerException("inet address argument is null.");
if (port == 0) {
} else {
}
}
int nativefd = checkAndReturnNativeFD();
}
int nativefd = checkAndReturnNativeFD();
if (s == null)
throw new NullPointerException("socket is null");
int newfd = -1;
if (timeout <= 0) {
} else {
configureBlocking(nativefd, false);
try {
if (newfd != -1) {
configureBlocking(newfd, true);
}
} finally {
configureBlocking(nativefd, true);
}
}
/* Update (SocketImpl)s' fd */
/* Update socketImpls remote port, address and localport */
}
int nativefd = checkAndReturnNativeFD();
return available0(nativefd);
}
throw new SocketException("Socket closed");
return;
}
int nativefd = checkAndReturnNativeFD();
}
// Intentional fallthrough after SO_REUSEADDR
@SuppressWarnings("fallthrough")
throws SocketException {
int nativefd = checkAndReturnNativeFD();
return;
}
int optionValue = 0;
switch(opt) {
case SO_REUSEADDR :
if (exclusiveBind) {
// SO_REUSEADDR emulated when using exclusive bind
isReuseAddress = on;
return;
}
// intentional fallthrough
case TCP_NODELAY :
case SO_OOBINLINE :
case SO_KEEPALIVE :
break;
case SO_SNDBUF :
case SO_RCVBUF :
case IP_TOS :
break;
case SO_LINGER :
if (on) {
} else {
optionValue = -1;
}
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 0; // return value doesn't matter.
}
// SO_REUSEADDR emulated when using exclusive bind
switch (opt) {
case TCP_NODELAY :
case SO_OOBINLINE :
case SO_KEEPALIVE :
case SO_REUSEADDR :
}
return value;
}
int nativefd = checkAndReturnNativeFD();
}
throw new SocketException("Socket closed");
}
static {
initIDs();
}
/* Native methods */
static native void initIDs();
boolean exclBind)
throws IOException;
throws IOException;
}