strServerAddr = s; // 连接地址
bConnected = false; // 连接状态
try
{
conServer = (StreamConnection)Connector.open(strServerAddr);
}
catch(Exception exception)
{
System.out.println("Connect server error");
bConnected = false;
return false;
}
bConnected = true;
System.out.println("connect ok!");
return true;
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/