socket_md.c revision 439
0N/A * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. Sun designates this 0N/A * particular file as subject to the "Classpath" exception as provided 0N/A * by Sun in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A * Table of Windows Sockets errors, the specific exception we 0N/A * throw for the error, and the error text. 0N/A * Note that this table excludes OS dependent errors. 0N/A {
WSAEMSGSIZE,
"The message is larger than the maximum supported by the underlying transport" },
0N/A {
WSAENOBUFS,
"No buffer space available (maximum connections reached?)" },
0N/A * Initialize Windows Sockets API support 0N/A * If we get a nonnull function pointer it might still be the case 0N/A * that some other thread is in the process of initializing the socket 0N/A * function pointer table, but our pointer should still be good. 0N/A * Check if there was an error - this is preferable to check if 0N/A * the socket is writable because some versions of Windows don't 0N/A * report a connected socket as being writable. 0N/A * Unable to establish connection - to get the reason we must 0N/A/* Additions to original follow */ 0N/A * throws to returns of SYS_ERR; we should improve the error codes 0N/A * eventually. Changed java objects to values the debugger back end can 0N/A * more easily deal with. 0N/A (
char *)&
onl,
sizeof(
long)) < 0) {
0N/A * On Windows the SO_REUSEADDR socket option doesn't implement 0N/A * BSD semantics. Specifically, the socket option allows multiple 0N/A * a process to bind with a previous connection in the TIME_WAIT 0N/A * state. Hence on Windows we never enable this option for TCP 0N/A * Check table for known winsock errors 0N/A /* initialize on first usage */