亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? standardsocketfactory.java

?? 用于JAVA數(shù)據(jù)庫(kù)連接.解壓就可用,方便得很
?? JAVA
字號(hào):
/* Copyright (C) 2002-2007 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as  published by the Free Software Foundation. There are special exceptions to the terms and conditions of the GPL  as it is applied to this software. View the full text of the  exception in file EXCEPTIONS-CONNECTOR-J in the directory of this  software distribution. This program 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 for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */package com.mysql.jdbc;import java.io.IOException;import java.lang.reflect.Constructor;import java.lang.reflect.InvocationTargetException;import java.lang.reflect.Method;import java.net.InetAddress;import java.net.Socket;import java.net.SocketException;import java.util.Properties;/** * Socket factory for vanilla TCP/IP sockets (the standard) *  * @author Mark Matthews */public class StandardSocketFactory implements SocketFactory {	public static final String TCP_NO_DELAY_PROPERTY_NAME = "tcpNoDelay";	public static final String TCP_KEEP_ALIVE_DEFAULT_VALUE = "true";	public static final String TCP_KEEP_ALIVE_PROPERTY_NAME = "tcpKeepAlive";	public static final String TCP_RCV_BUF_PROPERTY_NAME = "tcpRcvBuf";	public static final String TCP_SND_BUF_PROPERTY_NAME = "tcpSndBuf";	public static final String TCP_TRAFFIC_CLASS_PROPERTY_NAME = "tcpTrafficClass";	public static final String TCP_RCV_BUF_DEFAULT_VALUE = "0";	public static final String TCP_SND_BUF_DEFAULT_VALUE = "0";	public static final String TCP_TRAFFIC_CLASS_DEFAULT_VALUE = "0";	public static final String TCP_NO_DELAY_DEFAULT_VALUE = "true";	/** Use reflection for pre-1.4 VMs */	private static Method setTraficClassMethod;	static {		try {			setTraficClassMethod = Socket.class.getMethod("setTrafficClass",					new Class[] { Integer.TYPE });		} catch (SecurityException e) {			setTraficClassMethod = null;		} catch (NoSuchMethodException e) {			setTraficClassMethod = null;		}	}	/** The hostname to connect to */	protected String host = null;	/** The port number to connect to */	protected int port = 3306;	/** The underlying TCP/IP socket to use */	protected Socket rawSocket = null;	/**	 * Called by the driver after issuing the MySQL protocol handshake and	 * reading the results of the handshake.	 * 	 * @throws SocketException	 *             if a socket error occurs	 * @throws IOException	 *             if an I/O error occurs	 * 	 * @return The socket to use after the handshake	 */	public Socket afterHandshake() throws SocketException, IOException {		return this.rawSocket;	}	/**	 * Called by the driver before issuing the MySQL protocol handshake. Should	 * return the socket instance that should be used during the handshake.	 * 	 * @throws SocketException	 *             if a socket error occurs	 * @throws IOException	 *             if an I/O error occurs	 * 	 * @return the socket to use before the handshake	 */	public Socket beforeHandshake() throws SocketException, IOException {		return this.rawSocket;	}	/**	 * Configures socket properties based on properties from the connection	 * (tcpNoDelay, snd/rcv buf, traffic class, etc).	 * 	 * @param props	 * @throws SocketException	 * @throws IOException	 */	private void configureSocket(Socket sock, Properties props) throws SocketException,			IOException {		try {			sock.setTcpNoDelay(Boolean.valueOf(					props.getProperty(TCP_NO_DELAY_PROPERTY_NAME,							TCP_NO_DELAY_DEFAULT_VALUE)).booleanValue());			String keepAlive = props.getProperty(TCP_KEEP_ALIVE_PROPERTY_NAME,					TCP_KEEP_ALIVE_DEFAULT_VALUE);			if (keepAlive != null && keepAlive.length() > 0) {				sock.setKeepAlive(Boolean.valueOf(keepAlive)						.booleanValue());			}			int receiveBufferSize = Integer.parseInt(props.getProperty(					TCP_RCV_BUF_PROPERTY_NAME, TCP_RCV_BUF_DEFAULT_VALUE));			if (receiveBufferSize > 0) {				sock.setReceiveBufferSize(receiveBufferSize);			}			int sendBufferSize = Integer.parseInt(props.getProperty(					TCP_SND_BUF_PROPERTY_NAME, TCP_SND_BUF_DEFAULT_VALUE));			if (sendBufferSize > 0) {				sock.setSendBufferSize(sendBufferSize);			}			int trafficClass = Integer.parseInt(props.getProperty(					TCP_TRAFFIC_CLASS_PROPERTY_NAME,					TCP_TRAFFIC_CLASS_DEFAULT_VALUE));			if (trafficClass > 0 && setTraficClassMethod != null) {				setTraficClassMethod.invoke(sock,						new Object[] { new Integer(trafficClass) });			}		} catch (Throwable t) {			unwrapExceptionToProperClassAndThrowIt(t);		}	}	/**	 * @see com.mysql.jdbc.SocketFactory#createSocket(Properties)	 */	public Socket connect(String hostname, int portNumber, Properties props)			throws SocketException, IOException {		if (props != null) {			this.host = hostname;			this.port = portNumber;			Method connectWithTimeoutMethod = null;			Method socketBindMethod = null;			Class socketAddressClass = null;			String localSocketHostname = props					.getProperty("localSocketAddress");			String connectTimeoutStr = props.getProperty("connectTimeout");			int connectTimeout = 0;			boolean wantsTimeout = (connectTimeoutStr != null					&& connectTimeoutStr.length() > 0 && !connectTimeoutStr					.equals("0"));			boolean wantsLocalBind = (localSocketHostname != null && localSocketHostname					.length() > 0);			boolean needsConfigurationBeforeConnect = socketNeedsConfigurationBeforeConnect(props);						if (wantsTimeout || wantsLocalBind || needsConfigurationBeforeConnect) {				if (connectTimeoutStr != null) {					try {						connectTimeout = Integer.parseInt(connectTimeoutStr);					} catch (NumberFormatException nfe) {						throw new SocketException("Illegal value '"								+ connectTimeoutStr + "' for connectTimeout");					}				}				try {					// Have to do this with reflection, otherwise older JVMs					// croak					socketAddressClass = Class							.forName("java.net.SocketAddress");					connectWithTimeoutMethod = Socket.class.getMethod(							"connect", new Class[] { socketAddressClass,									Integer.TYPE });					socketBindMethod = Socket.class.getMethod("bind",							new Class[] { socketAddressClass });				} catch (NoClassDefFoundError noClassDefFound) {					// ignore, we give a better error below if needed				} catch (NoSuchMethodException noSuchMethodEx) {					// ignore, we give a better error below if needed				} catch (Throwable catchAll) {					// ignore, we give a better error below if needed				}				if (wantsLocalBind && socketBindMethod == null) {					throw new SocketException(							"Can't specify \"localSocketAddress\" on JVMs older than 1.4");				}				if (wantsTimeout && connectWithTimeoutMethod == null) {					throw new SocketException(							"Can't specify \"connectTimeout\" on JVMs older than 1.4");				}			}			if (this.host != null) {				if (!(wantsLocalBind || wantsTimeout || needsConfigurationBeforeConnect)) {					InetAddress[] possibleAddresses = InetAddress							.getAllByName(this.host);					Throwable caughtWhileConnecting = null;					// Need to loop through all possible addresses, in case					// someone has IPV6 configured (SuSE, for example...)					for (int i = 0; i < possibleAddresses.length; i++) {						try {							this.rawSocket = new Socket(possibleAddresses[i],									port);							configureSocket(this.rawSocket, props);							break;						} catch (Exception ex) {							caughtWhileConnecting = ex;						}					}					if (rawSocket == null) {						unwrapExceptionToProperClassAndThrowIt(caughtWhileConnecting);					}				} else {					// must explicitly state this due to classloader issues					// when running on older JVMs :(					try {						InetAddress[] possibleAddresses = InetAddress								.getAllByName(this.host);						Throwable caughtWhileConnecting = null;						Object localSockAddr = null;						Class inetSocketAddressClass = null;						Constructor addrConstructor = null;						try {							inetSocketAddressClass = Class									.forName("java.net.InetSocketAddress");							addrConstructor = inetSocketAddressClass									.getConstructor(new Class[] {											InetAddress.class, Integer.TYPE });							if (wantsLocalBind) {								localSockAddr = addrConstructor										.newInstance(new Object[] {												InetAddress														.getByName(localSocketHostname),												new Integer(0 /*																 * use ephemeral																 * port																 */) });							}						} catch (Throwable ex) {							unwrapExceptionToProperClassAndThrowIt(ex);						}						// Need to loop through all possible addresses, in case						// someone has IPV6 configured (SuSE, for example...)						for (int i = 0; i < possibleAddresses.length; i++) {							try {								this.rawSocket = new Socket();								configureSocket(this.rawSocket, props);								Object sockAddr = addrConstructor										.newInstance(new Object[] {												possibleAddresses[i],												new Integer(port) });								// bind to the local port, null is 'ok', it								// means								// use the ephemeral port								socketBindMethod.invoke(rawSocket,										new Object[] { localSockAddr });								connectWithTimeoutMethod.invoke(rawSocket,										new Object[] { sockAddr,												new Integer(connectTimeout) });								break;							} catch (Exception ex) {									this.rawSocket = null;								caughtWhileConnecting = ex;							}						}						if (this.rawSocket == null) {							unwrapExceptionToProperClassAndThrowIt(caughtWhileConnecting);						}					} catch (Throwable t) {						unwrapExceptionToProperClassAndThrowIt(t);					}				}				return this.rawSocket;			}		}		throw new SocketException("Unable to create socket");	}	/**	 * Does the configureSocket() need to be called before the socket is	 * connect()d based on the properties supplied?	 * 	 */	private boolean socketNeedsConfigurationBeforeConnect(Properties props) {		int receiveBufferSize = Integer.parseInt(props.getProperty(				TCP_RCV_BUF_PROPERTY_NAME, TCP_RCV_BUF_DEFAULT_VALUE));		if (receiveBufferSize > 0) {			return true;		}		int sendBufferSize = Integer.parseInt(props.getProperty(				TCP_SND_BUF_PROPERTY_NAME, TCP_SND_BUF_DEFAULT_VALUE));		if (sendBufferSize > 0) {			return true;		}		int trafficClass = Integer.parseInt(props.getProperty(				TCP_TRAFFIC_CLASS_PROPERTY_NAME,				TCP_TRAFFIC_CLASS_DEFAULT_VALUE));		if (trafficClass > 0 && setTraficClassMethod != null) {			return true;		}		return false;	}	private void unwrapExceptionToProperClassAndThrowIt(			Throwable caughtWhileConnecting) throws SocketException,			IOException {		if (caughtWhileConnecting instanceof InvocationTargetException) {			// Replace it with the target, don't use 1.4 chaining as this still			// needs to run on older VMs			caughtWhileConnecting = ((InvocationTargetException) caughtWhileConnecting)					.getTargetException();		}		if (caughtWhileConnecting instanceof SocketException) {			throw (SocketException) caughtWhileConnecting;		}		if (caughtWhileConnecting instanceof IOException) {			throw (IOException) caughtWhileConnecting;		}		throw new SocketException(caughtWhileConnecting.toString());	}}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av不卡一区二区三区| 日本韩国一区二区三区| 亚洲精品日韩一| 日韩亚洲欧美在线观看| 色综合久久88色综合天天| 麻豆精品一二三| 一区av在线播放| 日本一区二区不卡视频| 欧美大片在线观看一区| 欧美性感一类影片在线播放| 成人蜜臀av电影| 国产在线一区二区综合免费视频| 亚洲一区二区三区四区中文字幕 | 日韩精品一区二区在线观看| 色诱亚洲精品久久久久久| 国产成人免费网站| 另类专区欧美蜜桃臀第一页| 无码av中文一区二区三区桃花岛| 成人欧美一区二区三区| 欧美激情在线一区二区三区| 精品美女被调教视频大全网站| 欧美三级中文字| 一本一道综合狠狠老| jizz一区二区| 成人h动漫精品一区二区| 国产精一区二区三区| 国内外精品视频| 精品一区二区三区不卡| 免费人成精品欧美精品| 日韩电影在线一区二区三区| 亚洲成人一区二区在线观看| 亚洲小少妇裸体bbw| 亚洲一区二区三区在线看| 亚洲男人天堂av网| 依依成人精品视频| 一区二区三区免费观看| 亚洲一区二区黄色| 亚洲成人精品在线观看| 亚洲大片精品永久免费| 亚洲午夜激情网页| 无码av中文一区二区三区桃花岛| 亚洲大片在线观看| 日本少妇一区二区| 久久草av在线| 国产老女人精品毛片久久| 国产成人精品综合在线观看| 国产成人av福利| 99久久精品久久久久久清纯| 色综合视频在线观看| 色美美综合视频| 欧美精品久久99| 日韩欧美中文一区| 国产三级久久久| 最新国产の精品合集bt伙计| 一区二区在线观看视频| 午夜精品久久久久久久| 久久成人免费网| 欧美午夜精品久久久久久孕妇 | 99精品一区二区| 色欧美片视频在线观看| 在线观看国产91| 欧美日韩国产首页| 日韩亚洲欧美一区| 中文字幕不卡在线| 亚洲一区二区精品久久av| 婷婷国产v国产偷v亚洲高清| 狠狠v欧美v日韩v亚洲ⅴ| 成人国产视频在线观看| 欧美天天综合网| www一区二区| 成人免费在线视频观看| 日本视频中文字幕一区二区三区| 国产一区二区伦理片| 一本色道综合亚洲| 欧美成人video| 中文字幕色av一区二区三区| 婷婷丁香久久五月婷婷| 国产91丝袜在线18| 欧美色图12p| 国产欧美一区二区精品久导航| 亚洲男人都懂的| 国产自产高清不卡| 色欧美88888久久久久久影院| 欧美一卡二卡在线观看| 国产精品久久久久影院| 免费在线观看不卡| 91在线视频观看| 日韩精品最新网址| 夜夜精品浪潮av一区二区三区| 精品一区二区三区不卡 | 99精品欧美一区二区三区小说| 欧美日韩三级视频| 欧美国产成人精品| 奇米影视7777精品一区二区| 成年人午夜久久久| 欧美videossexotv100| 一区二区免费视频| 国产成人精品三级| 日韩一卡二卡三卡国产欧美| 依依成人综合视频| 粉嫩嫩av羞羞动漫久久久| 91精品国产色综合久久不卡蜜臀 | 一区二区免费看| 国产成人自拍高清视频在线免费播放| 久久久久久久久久久99999| 1区2区3区欧美| 国产资源精品在线观看| 91麻豆精品国产91久久久久| 亚洲欧美日韩一区| 成人爱爱电影网址| 久久免费看少妇高潮| 毛片av中文字幕一区二区| 欧美日韩美女一区二区| 亚洲精品国产高清久久伦理二区| 成人综合婷婷国产精品久久蜜臀 | 欧美老年两性高潮| |精品福利一区二区三区| 大陆成人av片| 欧美激情资源网| 国产在线一区二区| 精品三级在线观看| 日本欧美一区二区| 欧美日韩国产一二三| 亚洲福利视频一区二区| 欧美亚洲自拍偷拍| 一区二区视频在线| 91色|porny| 亚洲欧美激情视频在线观看一区二区三区| 国产精品1区2区| 国产色一区二区| 国产成人在线影院| 欧美国产综合色视频| 成人中文字幕合集| 欧美高清在线一区二区| 成人美女在线视频| 亚洲天堂免费在线观看视频| 91麻豆123| 亚洲午夜在线观看视频在线| 91久久线看在观草草青青| 亚洲人亚洲人成电影网站色| 91麻豆国产在线观看| 亚洲午夜久久久久久久久电影院| 欧美综合久久久| 日韩电影免费一区| 精品欧美黑人一区二区三区| 国产一区二区调教| 国产精品入口麻豆九色| 91麻豆福利精品推荐| 亚洲18影院在线观看| 日韩午夜激情av| 国产精品18久久久久久久久久久久| 欧美国产精品中文字幕| 91亚洲精华国产精华精华液| 一区二区三区免费在线观看| 欧美高清你懂得| 韩国精品主播一区二区在线观看| 国产欧美精品一区二区色综合朱莉| 成人毛片在线观看| 一二三四社区欧美黄| 日韩情涩欧美日韩视频| 国产成人精品一区二| 有坂深雪av一区二区精品| 91精品国产综合久久婷婷香蕉 | 风流少妇一区二区| 亚洲人成网站色在线观看| 欧美日韩一级二级三级| 久久91精品国产91久久小草| 国产精品无人区| 欧美久久久一区| 国产福利一区在线| 亚洲国产视频一区二区| 久久久久久久久久久久久女国产乱| aaa欧美日韩| 秋霞av亚洲一区二区三| 中文字幕高清一区| 欧美精品777| 成人激情小说网站| 日韩激情av在线| 中文字幕一区二区三区四区不卡| 欧美久久久久久久久中文字幕| 国产精品18久久久久久久网站| 亚洲一二三专区| 欧美经典一区二区| 在线电影一区二区三区| 成人午夜激情视频| 日本午夜一本久久久综合| 中文字幕亚洲欧美在线不卡| 日韩无一区二区| 欧美自拍偷拍一区| 成人动漫中文字幕| 久久国产精品第一页| 一区二区三区在线视频观看58| 久久久噜噜噜久久人人看| 欧美久久久久久久久久| 97久久超碰国产精品| 国产一本一道久久香蕉| 日韩制服丝袜先锋影音| 亚洲免费大片在线观看| 欧美国产亚洲另类动漫| 日韩欧美一级片|