Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java ApacheMina等待vs不间断地等待_Java_Apache Mina - Fatal编程技术网

Java ApacheMina等待vs不间断地等待

Java ApacheMina等待vs不间断地等待,java,apache-mina,Java,Apache Mina,这两种方法的区别是什么?在哪种情况下,应使用一个而不是另一个 /** * Wait for the asynchronous operation to complete with the specified timeout. * * @return <tt>true</tt> if the operation is completed. */ boolean await(long timeoutMillis) throws InterruptedException

这两种方法的区别是什么?在哪种情况下,应使用一个而不是另一个

/**
 * Wait for the asynchronous operation to complete with the specified timeout.
 *
 * @return <tt>true</tt> if the operation is completed.
 */
boolean await(long timeoutMillis) throws InterruptedException;
/**
*等待异步操作在指定的超时时间内完成。
*
*@如果操作完成,则返回true。
*/
布尔等待(longtimeoutmillis)抛出中断异常;

/**
 * Wait for the asynchronous operation to complete with the specified timeout
 * uninterruptibly.
 *
 * @return <tt>true</tt> if the operation is finished.
 */
boolean awaitUninterruptibly(long timeoutMillis);
/**
*等待异步操作在指定的超时时间内完成
*不间断地。
*
*@如果操作完成,则返回true。
*/
不间断地等待(长超时毫秒);

你知道什么是中断吗?thread.interrupt()?现在你知道一个会忽略这个调用/标志,另一个会抛出一个异常。这似乎毫无意义。也许你想得太多了。告诉自己这很简单