X-Git-Url: https://git.tokkee.org/?p=sysdb%2Fgo.git;a=blobdiff_plain;f=client%2Fclient.go;h=34a0434a1eeda23886d00ad34565b97c1226c22f;hp=131fdd5f1634e82b046a594babef1216c7f4a5ea;hb=414ad0469c90b2c5487394646571e4e737d747be;hpb=7323a9e21572ac808614512b5e3730aab758d131 diff --git a/client/client.go b/client/client.go index 131fdd5..34a0434 100644 --- a/client/client.go +++ b/client/client.go @@ -120,22 +120,22 @@ func Connect(addr, user string) (*Conn, error) { // Any blocked Send or Receive operations will be unblocked and return errors. func (c Conn) Close() { c.c.Close() } -// Send encodes the specified message and sends it to the server. +// Send sends the specified raw message to the server. // // Send operations block until the full message could be written to the // underlying sockets. This ensures that server and client don't get out of // sync. func (c Conn) Send(m *proto.Message) error { - return proto.Encode(c.c, m) + return proto.Write(c.c, m) } -// Receive waits for a reply from the server and returns the decoded message. +// Receive waits for a reply from the server and returns the raw message. // // Receive operations block until a full message could be read from the // underlying socket. This ensures that server and client don't get out of // sync. func (c Conn) Receive() (*proto.Message, error) { - return proto.Decode(c.c) + return proto.Read(c.c) } // vim: set tw=78 sw=4 sw=4 noexpandtab :