Select模式下级联文件传输服务器的实现  被引量:2

Implementation of Cascaded File Transfer Server in Select Mode

在线阅读下载全文

作  者:邰非[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.

关 键 词:SELECT 阻塞模式 非阻塞模式 

分 类 号:TP393[自动化与计算机技术—计算机应用技术]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象