[muscle] Re: zlib encoding and muscled

  • From: "Jeremy Friesner" <jaf@xxxxxxxxxxxx>
  • To: muscle@xxxxxxxxxxxxx
  • Date: Sun, 06 Jun 2004 18:14:24 PDT (-0700)

Hi Wilson,

> Very cool!

Thanks!  :^)
 
> I don't see an obvious way to set the outgoing encoding to zlib for the 
> muscled server.  Is it done automatically if I have 
> MUSCLE=5FMESSAGE=5FENCODING=5FZLIB defined=3F  If so, how would I specify an 
> encoding level=3F  Do I need to modify the muscled server code=3F

No need to modify the server code.

> Also, how does a client notify the server that it'll accept zlib=3F  I 
> see a a method MessageIOGateway::SetOutgoingEncoding(), but no such 
> method SetIncomingEncoding.

I think the two questions above are both the same question, which is, "how to I 
get the muscle server to zlib-compress the Messages that it sends back to the 
client=3F".  If I understood wrong, please let me know.

In any case, here is how to tell the muscled server to zlib-compress the 
Messages that it sends to your client:

int32 encodingLevel =3D 9;  // 9 is maximum compression, 1 is minimum, etc.
MessageRef msg =3D GetMessageFromPool(PR=5FCOMMAND=5FSETPARAMETERS);
if ((msg())&&(msg()->AddInt32(PR=5FNAME=5FREPLY=5FENCODING, encodingLevel) 
=3D=3D B=5FNO=5FERROR))
{
   // insert your code to send msg to the server here
}

-Jeremy



Other related posts: