// 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

最新文章

  1. java 正则匹配括号对以及其他成对出现的模式
  2. 更改WAS Profiles的概要文件的server1的SDK版本
  3. phpcms专题路径修改
  4. Qt 5.7设置调试器
  5. linux 安装samba
  6. Redhat EL安装curses
  7. NGUI 实现 透明底图遮罩 && 人物像素变黑
  8. 通过ajax获得json数据后格式的转换
  9. SPRING IN ACTION 第4版笔记-第六章RENDERING WEB VIEWS-002- Spring的JSP标签之form标签(<sf:input><sf:errors><sf:form>)
  10. Javascript 完美运动框架——逐行分析代码,让你轻松了解运动的原理
  11. android入门——Service
  12. get 和 post请求的区别
  13. 关于Uncaught SyntaxError: Unexpected token o in JSON at position 1,chrome持续报错的相关解析
  14. hud 2577 How to Type
  15. 学习笔记TF065:TensorFlowOnSpark
  16. spring_08aop原理及案例
  17. FastClick用法
  18. 20145215《网络对抗》Exp8 Web基础
  19. MySql 远程连接的条件
  20. 高性能LAMP程序设计

热门文章

  1. angular学习笔记(二十七)-$http(5)-使用$http构建RESTful架构
  2. Spark大师之路:广播变量(Broadcast)源码分析
  3. py自动化之环境配置
  4. 知乎:在卡内基梅隆大学 (Carnegie Mellon University) 就读是怎样一番体验?
  5. 替换python字典中的key值
  6. java 多线程1:进程与线程概述
  7. RTX——第15章 互斥信号量
  8. 自定义maven变量以及maven内置常量
  9. silverlight调用WebService传递json接收绑定数据
  10. 【Unity笔记】UGUI中Canvas屏幕适配