Class DefaultConnection
java.lang.Object
com.github.tobato.fastdfs.domain.conn.DefaultConnection
- All Implemented Interfaces:
Connection
默认连接实现
- Author:
- tobato
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultConnection(InetSocketAddress address, int soTimeout, int connectTimeout, Charset charset) 创建与服务端连接 -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.github.tobato.fastdfs.domain.conn.Connection
getCharset
-
Constructor Details
-
DefaultConnection
public DefaultConnection(InetSocketAddress address, int soTimeout, int connectTimeout, Charset charset) 创建与服务端连接- Parameters:
address- 地址soTimeout- 超时时长connectTimeout- 链接超时时长charset- 字符集
-
-
Method Details
-
close
public void close()正常关闭连接- Specified by:
closein interfaceConnection
-
isClosed
public boolean isClosed()连接是否关闭- Specified by:
isClosedin interfaceConnection- Returns:
- 是否关闭
-
isValid
public boolean isValid()检查连接是否有效- Specified by:
isValidin interfaceConnection- Returns:
- 是否有效
-
getOutputStream
获取输出流- Specified by:
getOutputStreamin interfaceConnection- Returns:
- 输出流
- Throws:
IOException- 异常
-
getInputStream
获取输入流- Specified by:
getInputStreamin interfaceConnection- Returns:
- 输入流
- Throws:
IOException- 异常
-