summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/client.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/client/client.go b/client/client.go
index 7fb9cc9..0fe967f 100644
--- a/client/client.go
+++ b/client/client.go
@@ -1,6 +1,8 @@
package client
import (
+ "errors"
+ "io"
"net"
"go.rctt.net/solec/core"
@@ -37,12 +39,12 @@ func (c *Client) Connect() error {
}
defer c.conn.Close()
- hs := core.Handshake{0, 1}
+ hs := core.Handshake{0, 1, core.ConnTypeUser}
if err := core.Send(c.conn, hs); err != nil {
return err
}
- auth := core.Auth{c.uname, c.pass}
+ auth := core.UserAuth{c.uname, c.pass}
if err := core.Send(c.conn, auth); err != nil {
return err
}
@@ -66,6 +68,9 @@ func (c *Client) read() {
payload, err := core.Read(c.conn)
if err != nil {
c.h.HandleError(err)
+ if errors.Is(err, io.EOF) {
+ break
+ }
}
c.handlePayload(payload)