Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Target Management » RSE:How to set timeout to stop the connecting state?
RSE:How to set timeout to stop the connecting state? [message #581215] Tue, 23 June 2009 06:20
hemeihua is currently offline hemeihuaFriend
Messages: 20
Registered: July 2009
Junior Member
I creat a FTP connection with the specified port such as 8092 which has
been used by other applications,and connect the FTP connection,but can not
open a Socket connected to a remote host at the specified port(8092) by
indirectly call {@link org.apache.commons.net.SocketClient$connect(String
hostname, int port)},and keep on connecting state for ever.

Here is my configuration:
- Windows XP PC running Eclipse 3.3.0 with plugin RSE (RSE-SDK-3.0.1.zip)

Here are my code:
/*creat a FTP connection with the specified port such as 8092*/
public IHost creatFTPConnection(String siteName, String ip, int port ){
IHost ftpSite = null;
IRSESystemType systemType =
RSECorePlugin.getTheCoreRegistry().getSystemTypeById(RSE_SYS TEM_TYPE_ID);
ISubSystemConfigurator[] configurators = getSubSystemConfigurators();
String[] defaultProfileNames =
sr.getSystemProfileManager().getActiveSystemProfileNames();
String aliasName = decorateAliasName(siteName);

if(defaultProfileNames.length > 0){
try {
ftpSite = sr.createHost(defaultProfileNames[0], systemType, aliasName,
ip,
"", "", 0,configurators);
} catch (Exception e) {
e.printStackTrace();
}
if(ftpSite != null){
ISubSystem[] subsystems = ftpSite.getSubSystems();
for (int i = 0; i < subsystems.length; i++){
ISubSystem subsystem = subsystems[i];
subsystem.getConnectorService().setPort(port);//port=8092
}
}
}
return ftpSite;
}

/*to connect the FTP connection with the specified port such as 8092*/
public class ConnectAllJob extends Job
{
private IHost fFtpSite, fTabDate;
private Viewer fViewer;
public ConnectAllJob(IHost site,IHost data, Viewer v )
{
super(SystemResources.ACTION_CONNECT_ALL_LABEL);
fFtpSite = site;
fTabDate = data;
fViewer = v;
}

public IStatus run(IProgressMonitor monitor)
{
List failedSystems = new ArrayList();
try
{
//forced instantiation of all subsystems
ISubSystem[] subsystems = fTabDate.getSubSystems();
for (int i = 0; i < subsystems.length; i++)
{
ISubSystem subsystem = subsystems[i];
IConnectorService system = subsystem.getConnectorService();
if (!subsystem.isConnected()
&&
subsystem.getSubSystemConfiguration().supportsSubSystemConne ct()
&& !failedSystems.contains(system))
{
try
{
subsystem.connect(monitor, false);
}
catch (SystemMessageException e) {
//TODO should we collect all messages and just show one dialog with
a MultiStatus?
failedSystems.add(system);
SystemMessageDialog.displayMessage(e);
}
catch (Exception e) {
failedSystems.add(system);
if ((e instanceof InterruptedException) || (e
instanceof OperationCanceledException)) {
// if the user was prompted for password and cancelled
// or if the connect was interrupted for some other
reason
// we don't attempt to connect the other subsystems
break;
}
SystemBasePlugin.logError(
e.getLocalizedMessage()!=null ? e.getLocalizedMessage() :
e.getClass().getName(),
e);

SystemMessageDialog.displayErrorMessage(getShell(), e.getMessage());
}
}
}
}
catch (Exception exc)
{
} // msg already shown
if (failedSystems.size() > 0)
{
return Status.CANCEL_STATUS;
}
}
}
How to set timeout to stop the connecting state or what is the best way to
handle this problem?
Somebody can help me?
Best Regards,
hemeihua
Previous Topic:RSE can't open files in some directory, which give the RSEG1067 error
Next Topic:RSE:What is the use of RemoteSystemsTempFiles in workspace?
Goto Forum:
  


Current Time: Fri Apr 26 02:15:24 GMT 2024

Powered by FUDForum. Page generated in 0.04097 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top