javax.net.ssl.SSLServerSocket.setSoTimeout()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(145)

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

SSLServerSocket.setSoTimeout介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

public void setSoTimeout(final int timeout) throws SocketException {
  delegate.setSoTimeout(timeout);
}

代码示例来源:origin: org.apache.thrift/libthrift

private static TServerSocket createServer(SSLServerSocketFactory factory, int port, int timeout, boolean clientAuth,
                 InetAddress ifAddress, TSSLTransportParameters params) throws TTransportException {
 try {
  SSLServerSocket serverSocket = (SSLServerSocket) factory.createServerSocket(port, 100, ifAddress);
  serverSocket.setSoTimeout(timeout);
  serverSocket.setNeedClientAuth(clientAuth);
  if (params != null && params.cipherSuites != null) {
   serverSocket.setEnabledCipherSuites(params.cipherSuites);
  }
  return new TServerSocket(new TServerSocket.ServerSocketTransportArgs().
   serverSocket(serverSocket).clientTimeout(timeout));
 } catch (Exception e) {
  throw new TTransportException("Could not bind to port " + port, e);
 }
}

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

@Override
public void setSoTimeout(int timeout) throws SocketException {
  ss.setSoTimeout(timeout);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

public void setSoTimeout(final int timeout) throws SocketException {
  delegate.setSoTimeout(timeout);
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron

public void setSoTimeout(final int timeout) throws SocketException {
  delegate.setSoTimeout(timeout);
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron-ssl

public void setSoTimeout(final int timeout) throws SocketException {
  delegate.setSoTimeout(timeout);
}

代码示例来源:origin: org.jsslutils/jsslutils-test-helpers

public void run() {
    ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
        2, 10, 60, TimeUnit.SECONDS,
        new LinkedBlockingQueue<Runnable>());
    try {
      int max = MiniSslClientServer.this.serverRequestNumber;
      for (int i = max; (i > 0 || max == 0) && (!stopServer); i--) {
        Socket acceptedSocket = null;
        try {
          serverSocket.setSoTimeout(serverTimeout);
          acceptedSocket = serverSocket.accept();
          Future<Object> f = threadPoolExecutor
              .submit(new RequestHandler(acceptedSocket));
          serverRequestsFutures.put(f);
        } catch (IOException e) {
          MiniSslClientServer.this.listeningServerException = e;
        } catch (InterruptedException e) {
          MiniSslClientServer.this.listeningServerException = e;
        }
      }
    } catch (RuntimeException e) {
      MiniSslClientServer.this.listeningServerException = e;
    }
  }
});

代码示例来源:origin: com.xiaomi.infra.galaxy/galaxy-thrift-api

private static TServerSocket createServer(SSLServerSocketFactory factory, int port, int timeout, boolean clientAuth,
                 InetAddress ifAddress, TSSLTransportParameters params) throws TTransportException {
 try {
  SSLServerSocket serverSocket = (SSLServerSocket) factory.createServerSocket(port, 100, ifAddress);
  serverSocket.setSoTimeout(timeout);
  serverSocket.setNeedClientAuth(clientAuth);
  if (params != null && params.cipherSuites != null) {
   serverSocket.setEnabledCipherSuites(params.cipherSuites);
  }
  return new TServerSocket(serverSocket, timeout);
 } catch (Exception e) {
  throw new TTransportException("Could not bind to port " + port, e);
 }
}

代码示例来源:origin: org.coosproject.messaging/messaging-j2se

serverSocket.setSoTimeout(500);

代码示例来源:origin: XiaoMi/galaxy-sdk-java

private static TServerSocket createServer(SSLServerSocketFactory factory, int port, int timeout, boolean clientAuth,
                 InetAddress ifAddress, TSSLTransportParameters params) throws TTransportException {
 try {
  SSLServerSocket serverSocket = (SSLServerSocket) factory.createServerSocket(port, 100, ifAddress);
  serverSocket.setSoTimeout(timeout);
  serverSocket.setNeedClientAuth(clientAuth);
  if (params != null && params.cipherSuites != null) {
   serverSocket.setEnabledCipherSuites(params.cipherSuites);
  }
  return new TServerSocket(serverSocket, timeout);
 } catch (Exception e) {
  throw new TTransportException("Could not bind to port " + port, e);
 }
}

代码示例来源:origin: org.coosproject.messaging/messaging-lib

listenPort = serverSocket.getLocalPort();
logger.info(" Listening on port " + listenPort);
serverSocket.setSoTimeout(500);

代码示例来源:origin: net.sf.grinder/grinder-http

/**
 * Factory method for server sockets.
 *
 * @param localEndPoint Local host and port.
 * @param timeout Socket timeout.
 * @return A new <code>ServerSocket</code>.
 * @exception IOException If an error occurs.
 */
public ServerSocket createServerSocket(EndPoint localEndPoint, int timeout)
 throws IOException {
 final SSLServerSocket socket =
  (SSLServerSocket)m_serverSocketFactory.createServerSocket(
   localEndPoint.getPort(), 50,
   InetAddress.getByName(localEndPoint.getHost()));
 socket.setSoTimeout(timeout);
 socket.setEnabledCipherSuites(socket.getSupportedCipherSuites());
 socket.setEnabledProtocols(socket.getSupportedProtocols());
 return socket;
}

代码示例来源:origin: com.noelios.restlet/com.noelios.restlet.ext.simple

serverSocket.setSoTimeout(60000);
setSocket(serverSocket);

相关文章