{
String instanceId=host+":" + port;
String slotName="TOMCAT:" + instanceId;
MsgContext mCtx=createMsgContext();
Msg msg=(Msg)mCtx.getMsg(0);
msg.reset();
C2BConverter c2b=mCtx.getConverter();
msg.appendByte( SHM_WRITE_SLOT );
appendString( msg, slotName, c2b );
int channelCnt=1;
if( unixDomain != null ) channelCnt++;
// number of groups. 0 means the default lb.
msg.appendInt( groups.size() );
for( int i=0; i<groups.size(); i++ ) {
appendString( msg, (String)groups.elementAt( i ), c2b);
appendString( msg, instanceId, c2b);
}
// number of channels for this instance
msg.appendInt( channelCnt );
// The body:
appendString(msg, "channel.socket:" + host + ":" + port, c2b );
msg.appendInt( 1 );
appendString(msg, "tomcatId", c2b);
appendString(msg, instanceId, c2b);
if( unixDomain != null ) {
appendString(msg, "channel.apr:" + unixDomain, c2b );
msg.appendInt(1);
appendString(msg, "tomcatId", c2b);
appendString(msg, instanceId, c2b);
}
if (log.isDebugEnabled())