Example #1
0
func (c *Client) Connect(rw io.ReadWriter, username, servicename string) error {
	c.c = g9p.NewClient(rw)
	go c.c.Start()

	err := c.setup(username, servicename)
	if err != nil {
		return err
	}
	return nil
}
Example #2
0
func (c *Client) Dial(network, address, username, servicename string) error {
	conn, err := net.Dial(network, address)
	if err != nil {
		return err
	}

	c.c = g9p.NewClient(conn)
	go c.c.Start()

	err = c.setup(username, servicename)
	if err != nil {
		return err
	}
	return nil
}