summaryrefslogtreecommitdiff
path: root/conn.go
diff options
context:
space:
mode:
authorfangyuanziti <[email protected]>2015-02-22 20:22:38 +0800
committerfangyuanziti <[email protected]>2015-02-22 20:28:58 +0800
commit5d8118d8abc94eff8e9723a5b5ad15e8310560a3 (patch)
treee8de870e83fa106e70a08d9b9c472cd642f6f82a /conn.go
parenteabb7feb995f0d542f1972909a69f4ab02c8f210 (diff)
add a new api: NewConnNet
Diffstat (limited to 'conn.go')
-rw-r--r--conn.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/conn.go b/conn.go
index 41ba5a8..1b7d838 100644
--- a/conn.go
+++ b/conn.go
@@ -29,6 +29,17 @@ func (c *Conn) connect(display string) error {
return err
}
+ return c.postConnect()
+}
+
+// connect init from to the net.Conn,
+func (c *Conn) connectNet(netConn net.Conn) error {
+ c.conn = netConn
+ return c.postConnect()
+}
+
+// do the postConnect action after Conn get it's underly net.Conn
+func (c *Conn) postConnect() error {
// Get authentication data
authName, authData, err := readAuthority(c.host, c.display)
noauth := false