Configure MessagePack to be a bit more like gob

By default codec's MessagePack encode/decode will convert a string
into a []byte.  Tweak the settings so that string -> string and []byte
-> []byte.
pull/1330/head
Julian Phillips 12 years ago
parent 2c0a7a501e
commit ee6a118090

@ -40,8 +40,11 @@ func newClientWithMux(mux *muxBroker, streamId uint32) (*Client, error) {
return nil, err
}
var h codec.MsgpackHandle
clientCodec := codec.GoRpc.ClientCodec(clientConn, &h)
h := &codec.MsgpackHandle{
RawToString: true,
WriteExt: true,
}
clientCodec := codec.GoRpc.ClientCodec(clientConn, h)
return &Client{
mux: mux,

@ -148,8 +148,11 @@ func (s *Server) Serve() {
}
defer stream.Close()
var h codec.MsgpackHandle
rpcCodec := codec.GoRpc.ServerCodec(stream, &h)
h := &codec.MsgpackHandle{
RawToString: true,
WriteExt: true,
}
rpcCodec := codec.GoRpc.ServerCodec(stream, h)
s.server.ServeCodec(rpcCodec)
}

Loading…
Cancel
Save