public void send(SessionMessage msg, Member dest) {
try
{
msg.setAddress(membershipService.getLocalMember());
Member destination = dest;
if ( (destination == null) && (msg.getEventType() == SessionMessage.EVT_GET_ALL_SESSIONS) ) {
if (membershipService.getMembers().length > 0)
destination = membershipService.getMembers()[0];
}
msg.setTimestamp(System.currentTimeMillis());
java.io.ByteArrayOutputStream outs = new java.io.ByteArrayOutputStream();
java.io.ObjectOutputStream out = new java.io.ObjectOutputStream(outs);
out.writeObject(msg);
byte[] data = outs.toByteArray();
if(destination != null) {
Member tcpdest = dest;
if ( (tcpdest != null) && (!membershipService.getLocalMember().equals(tcpdest))) {
clusterSender.sendMessage(msg.getSessionID(), data, tcpdest);
}//end if
}
else {