[ome-devel] loadOmero('localhost') from Matlab

Josh Moore josh at glencoesoftware.com
Wed Feb 1 13:12:31 GMT 2012


On Feb 1, 2012, at 1:18 PM, Munro, Ian wrote:

> Hello
> 
> I'm curently developing  some Matlab code to access OMERO using a virtualbox server
> running on the development machine to do the testing.
> 
> when I call
> 
> client = loadOmero('localhost');
> 
> either when the server isn't running or with an invalid address
> it returns with no problem.
> 
> Is there a way of telling whether the value returned ( 'client' in the code snippet )
> represents a valid server or not?
> 
> The reason I want to know is that if the server isn't valid
> a subsequent call to
> 
> session = client.createSession(userName,passwd);
> 
> fails to return properly.

Hi Ian,

the only way to know whether or not the client will connect to the given server is to call createSession. If you call loadOmero with more than one return argument, however, createSession will be called for you:

 properties = java.util.Properties();
 properties.setProperty('omero.host', 'localhost');
 properties.setProperty('omero.user', userName);
 % etc.
 [client, session] = loadOmero(properties);
 % similarly with passing an Ice.Config file.

Cheers,
~Josh

> Thanks
> Ian



More information about the ome-devel mailing list