/**
* Creates and returns the resource.
*
* @return The resource
*/
@Override
protected CommPortAdapter createResourceImpl()
{
//get COMM port name
String portName=this.getPortName();
//get timeout
int timeout=this.getTimeOut();
CommPort commPort=null;
try
{
//get COMM port identifier
CommPortIdentifier commPortIdentifier=this.getPortIdentifier(portName);
//open connection
commPort=commPortIdentifier.open("fax4j",timeout);
}
catch(Exception exception)
{
throw new FaxException("Unable to connect to COMM port: "+portName,exception);
}
//create adapter wrapper
CommPortAdapter adapter=new RXTXCommPortAdapter(commPort);
return adapter;
}
RXTXCommPortConnectionFactory.java 文件源码
java
阅读 15
收藏 0
点赞 0
评论 0
项目:fax4j
作者:
评论列表
文章目录