[brlcad-commits] SF.net SVN: brlcad:[43304] geomcore/trunk/src/interfaces/java/src/org/ brlcad/geo
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <dav...@us...> - 2011-02-14 20:38:27
|
Revision: 43304 http://brlcad.svn.sourceforge.net/brlcad/?rev=43304&view=rev Author: davidloman Date: 2011-02-14 20:38:21 +0000 (Mon, 14 Feb 2011) Log Message: ----------- Start wiring in the GSClient's ability to establish comms with a GS Modified Paths: -------------- geomcore/trunk/src/interfaces/java/src/org/brlcad/geometryservice/minimalclient/MinimalGSClient.java Modified: geomcore/trunk/src/interfaces/java/src/org/brlcad/geometryservice/minimalclient/MinimalGSClient.java =================================================================== --- geomcore/trunk/src/interfaces/java/src/org/brlcad/geometryservice/minimalclient/MinimalGSClient.java 2011-02-14 20:35:54 UTC (rev 43303) +++ geomcore/trunk/src/interfaces/java/src/org/brlcad/geometryservice/minimalclient/MinimalGSClient.java 2011-02-14 20:38:21 UTC (rev 43304) @@ -28,13 +28,16 @@ import java.awt.HeadlessException; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.net.InetAddress; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JFrame; import javax.swing.JPanel; +import org.brlcad.geometryservice.GSStatics; import org.brlcad.geometryservice.minimalclient.cmd.CmdManager; +import org.brlcad.geometryservice.net.GSConnection; /** * @author david.h.loman @@ -44,6 +47,11 @@ private static final long serialVersionUID = -839046331894878664L; + //TODO upgrade this to a map of some sort later so we can manage multiple connections + private GSConnection conn ; + + + /** * @throws HeadlessException */ @@ -115,4 +123,22 @@ /* Object source = event.getSource(); */ } + public boolean connectToHost(InetAddress addy, short port, String uname, String passwd){ + + try { + this.conn = GSConnection.connectToHost(addy, port, uname, passwd); + + } catch (Exception e) { + GSStatics.stdErr.println(e.getMessage()); + return false; + } + + if (this.conn == null) { + GSStatics.stdErr.println("Null GSConnection without throwing an error... odd."); + return false; + } + + return true; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |