检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:邰非[1,2] 林健伟 张开骁 王国栋[1] TAI Fei;LIN Jian-wei;ZHANG Kai-xiao;WANG Guo-dong(Department of Science,Hohai University,Nanjing Jiangsu 210098;Yuanzhi Information Technology Co.,Ltd.,Nanjing Jiangsu 210008)
机构地区:[1]河海大学理学院,江苏南京210098 [2]南京远志资讯科技公司研发中心,江苏南京210008
出 处:《数字技术与应用》2020年第9期48-50,共3页Digital Technology & Application
摘 要:Select是Windows操作系统提供的一个API函数,它具备强大的网络探测能力且使用方便。众所周知,在阻塞模式下网络通讯可能造成进程挂起,较为可靠的方法是采用非阻塞模式,但Windows底层所提供的socket函数在非阻塞方式下返回值可信度很低,如果通过Select模式结合超时处理来获取返回状态,会大大提升程序返回值的可信度。本文采用java语言来实现一个基于TCP/UDP协议的级联文件传输服务器,其中利用Select模式对端口的可读写性进行探测。通过实际测试,在有效地防止进程挂起的同时能准确获取返回值,从而正确判断端口状态,从侧面增强系统的健壮性与可维护性。Select is an API function provided by Windows operating system.It has strong network detection ability and is easy to use.As we all know,network communication may cause process suspensed in blocking mode.The more reliable method is to use non-blocking mode,but the socket function provided by the bottom layer of windows has a low reliability of return value in nonblocking mode.If the return status is obtained through select mode combined with timeout processing,the reliability of return value of the program will be greatly improved.In this paper,We use Java language to implement a cascaded file transfer server based on TCP/UDP protocol,Here select mode is used to detect the readability of the port.Through the actual test,the return value can be accurately obtained while the process is effectively prevented from being suspended,so as to correctly judge the port status and enhance the robustness and maintainability of the system.
分 类 号:TP393[自动化与计算机技术—计算机应用技术]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:18.191.235.161