Re: [eclipse-clp-users] Remote Connection Prolog

From: Kish Shen <kisshen_at_...5...>
Date: Fri, 17 Sep 2010 00:38:15 +0100
Hi Mario,

On 15/09/2010 13:42, Mario Gianni wrote:

>
> remote_connect('localhost'/6000,P,G).
>
> from Java Application I have writen this code in a try/catch block
>
>   InetAddress host = InetAddress.getByName("localhost");
>   RemoteEclipse eclipse = new RemoteEclipse(host,6000);
>   eclipse.rpc("env"); % for example
>   eclipse.disconnect();
>
> the connection is established but after command execution rpc I receive by
> eclipse this message
>
> uncaught exception in exit_block(peer_abort_disconnected)
>
> Two questions:
>
> 1) how to manage this exception
> 2) how to not disconnect from eclipe
>

Your question 2 is easy to answer -- you can avoid disconnecting from 
ECLiPSe by not disconnecting -- you are explicitly disconnecting by 
calling eclipse.disconnect(). By not making this call, you will not be 
disconnected. Since you are calling this, is there any reason you are 
doing so?

The remote interface is used for both OutOfProcessEclipse and 
EmbeddedEclipse, except that the starting and connection to an ECLiPSe 
process is done for you in OutOfProcessEclipse. The way we expected the 
interface to be used is that you connect your Java application to 
ECLiPSe when you start, and do not disconnect until you no longer need 
ECLiPSe, or when you quit from your application.

As for question 1, you can avoid the exception by not disconnecting. 
However, what you are seeing seems to be a bug, because the 
peer_abort_disconnected exception should only be raised when ECLiPSe is 
unexpectedly disconnected from the Java application (e.g. if the 
application crashed). In your case, the disconnection is expected, so no 
exception should be raised. I need to look at this in more detail to see 
how it can be fixed.

Cheers,

Kish


-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.
Received on Fri Sep 17 2010 - 00:13:33 CEST

This archive was generated by hypermail 2.2.0 : Mon Jul 09 2018 - 02:05:29 CEST