aboutsummaryrefslogtreecommitdiff
path: root/nexgb/conn.go
diff options
context:
space:
mode:
authorfangyuanziti <tiziyuanfang@gmail.com>2015-02-22 20:22:38 +0800
committerPřemysl Janouch <p@janouch.name>2018-09-08 16:49:23 +0200
commita1d1151017ada36a0431969e3e05f35f1dd6204f (patch)
tree0c39192812e08bccc6878dd59353cdc71cee9b9b /nexgb/conn.go
parentef8155bf17787473a58f00d54cfc8a7e16ee8708 (diff)
downloadhaven-a1d1151017ada36a0431969e3e05f35f1dd6204f.tar.gz
haven-a1d1151017ada36a0431969e3e05f35f1dd6204f.tar.xz
haven-a1d1151017ada36a0431969e3e05f35f1dd6204f.zip
add a new api: NewConnNet
Diffstat (limited to 'nexgb/conn.go')
-rw-r--r--nexgb/conn.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/nexgb/conn.go b/nexgb/conn.go
index 41ba5a8..1b7d838 100644
--- a/nexgb/conn.go
+++ b/nexgb/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