private class SBSessionListener extends SessionAdapter {
@Override
public void sessionEstablished(Session session) {
if (createdByOwner) {
OutgoingUSRAuthSB message = new OutgoingUSRAuthSB(
getMessenger().getActualMsnProtocol());
message.setEmail(getMessenger().getOwner().getEmail());
message.setAuthStr(authStr);
send(message, false);
} else {
OutgoingANS message = new OutgoingANS(getMessenger()
.getActualMsnProtocol());
message.setEmail(getMessenger().getOwner().getEmail());
message.setAuthStr(authStr);
message.setSessionId(sessionId);
send(message, false);
}
connection.setInternalIP(BasicSwitchboard.this.session
.getLocalAddress());
connection.setInternalPort(BasicSwitchboard.this.session