org.apache.flink.util.IOUtils.closeSocket()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中org.apache.flink.util.IOUtils.closeSocket()方法的一些代码示例,展示了IOUtils.closeSocket()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IOUtils.closeSocket()方法的具体详情如下:
包路径:org.apache.flink.util.IOUtils
类名称:IOUtils
方法名:closeSocket

IOUtils.closeSocket介绍

[英]Closes the socket ignoring IOException.
[中]关闭套接字,忽略IOException。

代码示例

代码示例来源:origin: apache/flink

@Override
  public void cancel() {
    isRunning = false;

    // we need to close the socket as well, because the Thread.interrupt() function will
    // not wake the thread in the socketStream.read() method when blocked.
    Socket theSocket = this.currentSocket;
    if (theSocket != null) {
      IOUtils.closeSocket(theSocket);
    }
  }
}

代码示例来源:origin: org.apache.flink/flink-streaming-java_2.10

@Override
  public void cancel() {
    isRunning = false;

    // we need to close the socket as well, because the Thread.interrupt() function will
    // not wake the thread in the socketStream.read() method when blocked.
    Socket theSocket = this.currentSocket;
    if (theSocket != null) {
      IOUtils.closeSocket(theSocket);
    }
  }
}

代码示例来源:origin: org.apache.flink/flink-streaming-java

@Override
  public void cancel() {
    isRunning = false;

    // we need to close the socket as well, because the Thread.interrupt() function will
    // not wake the thread in the socketStream.read() method when blocked.
    Socket theSocket = this.currentSocket;
    if (theSocket != null) {
      IOUtils.closeSocket(theSocket);
    }
  }
}

代码示例来源:origin: org.apache.flink/flink-streaming-java_2.11

@Override
  public void cancel() {
    isRunning = false;

    // we need to close the socket as well, because the Thread.interrupt() function will
    // not wake the thread in the socketStream.read() method when blocked.
    Socket theSocket = this.currentSocket;
    if (theSocket != null) {
      IOUtils.closeSocket(theSocket);
    }
  }
}

相关文章