TpHeader hdr=(TpHeader)msg.getHeader(this.id);
if(hdr == null)
throw new Exception("message " + msg + " doesn't have a transport header, cannot route it");
String group=cluster_name != null? cluster_name.toString() : null;
ByteArrayDataOutputStream dos=new ByteArrayDataOutputStream((int)(msg.size() + 50));
writeMessage(msg, dos, dest == null);
if(stats) {
num_msgs_sent++;
num_bytes_sent+=dos.position();
}
List<RouterStub> stubs = stubManager.getStubs();
if(dest == null)
tunnel_policy.sendToAllMembers(stubs, group, dos.buffer(), 0, dos.position());
else
tunnel_policy.sendToSingleMember(stubs, group, dest, dos.buffer(), 0, dos.position());
}