parameter "timeout" in socketchannel does not work
// Accept the connection and make it non-blocking
SocketChannel socketChannel = serverSocketChannel.accept();
Socket socket = socketChannel.socket();
//socket.setSoTimeout(1000*10);//it will be timeout if idle more than 10s
//after testing, i found the parameter in socketchannel didnot work
//the following is what i google:
//you don't need a timeout,
//because SC's (SC means SocketChannel) do a non-blocking Connect, and send a message to the Selector with message type CONNECTED when that becomes the case
//in the protosocket, read method is a blocking invocation, so it need a "timeout" parameter ,in case some evil connection
parameter "timeout" in socketchannel does not work的更多相关文章
- JUnit4:Test注解的两个属性:expected和timeout
JUnit4:Test文档中的解释: The Test annotation supports two optional parameters. The first, expected, declar ...
- Test注解的两个属性:expected和timeout
JUnit4:Test文档中的解释: The Test annotation supports two optional parameters. The first, expected, declar ...
- ajax 请求 对json传的处理 Jquery 使用Ajax获取后台返回的Json数据后,页面处理
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- JUnit4注解基本介绍
@After If you allocate external resources in a Before method you need to release them after the test ...
- net programming guid
Beej's Guide to Network Programming Using Internet Sockets Brian "Beej Jorgensen" Hallbeej ...
- Jquery 使用Ajax获取后台返回的Json数据后,页面处理
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Jenkins持续集成学习-Windows环境进行.Net开发2
目录 Jenkins持续集成学习-Windows环境进行.Net开发2 目录 前言 目标 使用 .Net Stardard 单元测试 流程 手动执行单元测试 自动执行单元测试 单元测试报告 上传Nug ...
- Java NIO通信的基础,基于TCP C/S例子介绍
为了更好的理解Netty异步事件驱动网络通信框架,有必要先了解一点Java NIO原生的通信理论,下面将结合基于TCP的例子程序,含客户端和服务端的源码,实现了Echo流程. Java NIO的核心概 ...
- MQTT协议笔记之mqtt.io项目HTTP协议支持
前言 MQTT协议诞生之初,就未曾考虑通过HTTP传输.这也正常,网络受限.不稳定网络不太适合HTTP(2G/3G网络大家使用WAP不也OK嘛).在网络较为充裕的桌面端而言,虽纯文本对比二进制而言没多 ...
随机推荐
- iOS-本地的推送
// // ViewController.m // 05-本地的推送 // // Created by hongqiangli on 2017/6/12. // #import "Vi ...
- AngularJS实现跨域请求
跨域,前端开发中经常遇到的问题,AngularJS实现跨域方式类似于Ajax,使用CORS机制. 下面阐述一下AngularJS中使用$http实现跨域请求数据. AngularJS XMLHttpR ...
- 使用konva来绘制一个矩形
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 分享一个上传图片,图片压缩Unsupported Image Type解决方案
http://blog.csdn.net/frankcheng5143/article/details/53185201 *************************************** ...
- 在Eclipse中给JRE-Library添加本地Javadoc
Eclipse中的JRE-Library的Javadoc默认是一个URL,指向oracle的一个web-page,那你在离线的时候就无法使用了,为了解决这个问题,你可以从oracle下载JDK-Spe ...
- Python 部署 flask 用uwsgi和nginx
安装uwsgi nginx 具体方法请百度 1.在项目目录下建立.ini文件 xad_uwsgi.ini [uwsgi] master=true #项目目录 chdir=/root/zhaoyingj ...
- 队列——PowerShell版
继续读啊哈磊<啊哈!算法>感悟系列——队列 地铁售票处排队,先来的人先到队首先买完先走,后来的人排在队尾等候后买完后走. 想买票,必须排在队尾:买完票,只能从队首离开. 这种先进先出(Fi ...
- 2013年五大主流浏览器 HTML5 和 CSS3 兼容性大比拼【转】
摘要: 这篇文章给大家带来<五大主流浏览器 HTML5 和 CSS3 兼容性大比拼>,让我们一起来看看2013年的浏览器现状.浏览器厂商之间的竞争促使各大浏览器对 HTML5 和 CSS3 ...
- war 宽度变窄
1.打开开始菜单-运行-输入Regedit 打开注册表编辑器 展开 HKEY_CURRENT_USER 继续展开 Software继续展开 Blizzard Entertainment 在Warcra ...
- 迭代获取ViewState
string s=""; System.Collections.IDictionaryEnumerator ie=ViewState.GetEnumerator(); while ...