本文整理了Java中java.net.Socket.isInputShutdown()
方法的一些代码示例,展示了Socket.isInputShutdown()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Socket.isInputShutdown()
方法的具体详情如下:
包路径:java.net.Socket
类名称:Socket
方法名:isInputShutdown
[英]Returns whether the incoming channel of the socket has already been closed.
[中]返回套接字的传入通道是否已关闭。
代码示例来源:origin: aws/aws-sdk-java
@Override
public boolean isInputShutdown() {
return sock.isInputShutdown();
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
private void closeSocketInput(Socket socket) {
try {
if (!socket.isInputShutdown()) {
socket.shutdownInput();
}
} catch (SocketException e) {
// There is no way to determine that client closed connection http://stackoverflow.com/a/10241044/999458
// So just to prevent log flooding don't log stacktrace
} catch (IOException e) {
// onError(new ProxyCacheException("Error closing socket input stream", e));
}
}
代码示例来源:origin: netty/netty
@Override
public boolean isInputShutdown() {
return socket.isInputShutdown() || !isActive();
}
代码示例来源:origin: redisson/redisson
@Override
public boolean isInputShutdown() {
return socket.isInputShutdown() || !isActive();
}
代码示例来源:origin: apache/zookeeper
/**
* See {@link Socket#isInputShutdown()}. Calling this method does not trigger mode detection.
*/
@Override
public boolean isInputShutdown() {
return getSocketAllowUnknownMode().isInputShutdown();
}
代码示例来源:origin: netty/netty
@Override
public boolean isInputShutdown() {
return javaChannel().socket().isInputShutdown() || !isActive();
}
代码示例来源:origin: wildfly/wildfly
@Override
public boolean isInputShutdown() {
return socket.isInputShutdown() || !isActive();
}
代码示例来源:origin: netty/netty
@Override
public boolean isShutdown() {
return socket.isInputShutdown() && socket.isOutputShutdown() || !isActive();
}
代码示例来源:origin: redisson/redisson
@Override
public boolean isInputShutdown() {
return javaChannel().socket().isInputShutdown() || !isActive();
}
代码示例来源:origin: netty/netty
@Override
public boolean isShutdown() {
Socket socket = javaChannel().socket();
return socket.isInputShutdown() && socket.isOutputShutdown() || !isActive();
}
代码示例来源:origin: jphp-group/jphp
@Signature
public Memory isInputShutdown(Environment env, Memory... args) {
return socket.isInputShutdown() ? Memory.TRUE : Memory.FALSE;
}
代码示例来源:origin: square/okhttp
/** Returns true if this connection is ready to host new streams. */
public boolean isHealthy(boolean doExtensiveChecks) {
if (socket.isClosed() || socket.isInputShutdown() || socket.isOutputShutdown()) {
return false;
}
if (http2Connection != null) {
return !http2Connection.isShutdown();
}
if (doExtensiveChecks) {
try {
int readTimeout = socket.getSoTimeout();
try {
socket.setSoTimeout(1);
if (source.exhausted()) {
return false; // Stream is exhausted; socket is closed.
}
return true;
} finally {
socket.setSoTimeout(readTimeout);
}
} catch (SocketTimeoutException ignored) {
// Read timed out; socket is good.
} catch (IOException e) {
return false; // Couldn't read; socket is closed.
}
}
return true;
}
代码示例来源:origin: sohutv/cachecloud
public boolean isConnected() {
return socket != null && socket.isBound() && !socket.isClosed() && socket.isConnected()
&& !socket.isInputShutdown() && !socket.isOutputShutdown();
}
代码示例来源:origin: redisson/redisson
@Override
public boolean isShutdown() {
return socket.isInputShutdown() && socket.isOutputShutdown() || !isActive();
}
代码示例来源:origin: redisson/redisson
@Override
public boolean isShutdown() {
Socket socket = javaChannel().socket();
return socket.isInputShutdown() && socket.isOutputShutdown() || !isActive();
}
代码示例来源:origin: wildfly/wildfly
@Override
public boolean isInputShutdown() {
return javaChannel().socket().isInputShutdown() || !isActive();
}
代码示例来源:origin: prestodb/presto
/** Returns true if this connection is ready to host new streams. */
public boolean isHealthy(boolean doExtensiveChecks) {
if (socket.isClosed() || socket.isInputShutdown() || socket.isOutputShutdown()) {
return false;
}
if (http2Connection != null) {
return !http2Connection.isShutdown();
}
if (doExtensiveChecks) {
try {
int readTimeout = socket.getSoTimeout();
try {
socket.setSoTimeout(1);
if (source.exhausted()) {
return false; // Stream is exhausted; socket is closed.
}
return true;
} finally {
socket.setSoTimeout(readTimeout);
}
} catch (SocketTimeoutException ignored) {
// Read timed out; socket is good.
} catch (IOException e) {
return false; // Couldn't read; socket is closed.
}
}
return true;
}
代码示例来源:origin: robovm/robovm
/**
* Returns an input stream to read data from this socket.
*
* @return the byte-oriented input stream.
* @throws IOException
* if an error occurs while creating the input stream or the
* socket is in an invalid state.
*/
public InputStream getInputStream() throws IOException {
checkOpenAndCreate(false);
if (isInputShutdown()) {
throw new SocketException("Socket input is shutdown");
}
return impl.getInputStream();
}
代码示例来源:origin: wildfly/wildfly
@Override
public boolean isShutdown() {
return socket.isInputShutdown() && socket.isOutputShutdown() || !isActive();
}
代码示例来源:origin: wildfly/wildfly
@Override
public boolean isShutdown() {
Socket socket = javaChannel().socket();
return socket.isInputShutdown() && socket.isOutputShutdown() || !isActive();
}
内容来源于网络,如有侵权,请联系作者删除!