}
private ActorClient getConnection()
{
if (_conn == null) {
HmtpClient client = new HmtpClient("http://" + getWatchdogAddress()
+ ":" + getWatchdogPort()
+ "/hmtp");
client.setVirtualHost("admin.resin");
String cookie = getAdminCookie();
if (cookie == null)
cookie = "";
long now = Alarm.getCurrentTime();
byte []encData = SelfEncryptedCookie.encrypt(cookie, now);
SelfEncryptedCredentials cred = new SelfEncryptedCredentials(encData);
client.connect("admin.resin", cred);
_conn = client;
}
return _conn;